35 ISerializationContextPtr context;
38 explicit ISerializer ( ISerializationContextPtr serContext );
46 void SetAttribute (
const std::string& name,
const std::string& value );
47 void SetAttribute (
const std::string& name,
const char* value );
48 void SetAttribute (
const std::string& name, uint32 value );
49 void SetAttribute (
const std::string& name, uint64 value );
50 void SetAttribute (
const std::string& name, int32 value );
51 void SetAttribute (
const std::string& name, int64 value );
52 void SetAttribute (
const std::string& name,
bool value );
53 void SetAttribute (
const std::string& name,
double value );
67 template<
typename ContextType >
70 assert( context !=
nullptr );
74 assert(
typeid( *context ) ==
typeid( ContextType ) );
77 return static_cast< ContextType*
>( context.get() );
WritingMode
Writing to file mode.
Definition: Serializer.h:22
void EnterArray(const std::string &name)
Tworzy tablicę o podanej nazwie.
Definition: Serializer.cpp:168
virtual ~ISerializer()
Destruktor.
Definition: Serializer.cpp:74
Serializers interface.
Definition: Serializer.h:31
bool SaveFile(const std::string &fileName, WritingMode mode=WritingMode::Sparing)
Zapisuje zserializowane dane do pliku.
Definition: Serializer.cpp:107
Plik zawiera definicje podstawowych typów zmiennych.
ContextType * GetContext()
Returns serialization context.
Definition: Serializer.h:68
std::string SaveString(WritingMode mode=WritingMode::Sparing)
Zwraca stringa zawierającego zserializowanego Jsona.
Definition: Serializer.cpp:83
void SetAttribute(const std::string &name, const std::string &value)
Ustawia parę ( nazwa, wartość ) w aktualnym obiekcie.
Definition: Serializer.cpp:187
void Exit()
Koniec tworzenia obiektu. EnterObject i ExitObject powinny być stosowane parami.
Definition: Serializer.cpp:151
void EnterObject(const std::string &name)
Tworzy obiekt o podanej nazwie.
Definition: Serializer.cpp:134
Definition: Serializer.cpp:25
Mode without spaces and tabulations.
Mode for reading by people.
ISerializer(ISerializationContextPtr serContext)
Konstruktor.
Definition: Serializer.cpp:65