Audacity 3.2.0
|
a class used to (de)serialize the project catalog More...
#include <ProjectSerializer.h>
Public Member Functions | |
ProjectSerializer (size_t allocSize=1024 *1024) | |
virtual | ~ProjectSerializer () |
void | StartTag (const wxString &name) override |
void | EndTag (const wxString &name) override |
void | WriteAttr (const wxString &name, const wxString &value) override |
void | WriteAttr (const wxString &name, const wxChar *value) override |
void | WriteAttr (const wxString &name, int value) override |
void | WriteAttr (const wxString &name, bool value) override |
void | WriteAttr (const wxString &name, long value) override |
void | WriteAttr (const wxString &name, long long value) override |
void | WriteAttr (const wxString &name, size_t value) override |
void | WriteAttr (const wxString &name, float value, int digits=-1) override |
void | WriteAttr (const wxString &name, double value, int digits=-1) override |
void | WriteData (const wxString &value) override |
void | Write (const wxString &data) override |
const MemoryStream & | GetDict () const |
const MemoryStream & | GetData () const |
bool | IsEmpty () const |
bool | DictChanged () const |
Public Member Functions inherited from XMLWriter | |
XMLWriter () | |
virtual | ~XMLWriter () |
virtual void | StartTag (const wxString &name) |
virtual void | EndTag (const wxString &name) |
void | WriteAttr (const wxString &name, const Identifier &value) |
virtual void | WriteAttr (const wxString &name, const wxString &value) |
virtual void | WriteAttr (const wxString &name, const wxChar *value) |
virtual void | WriteAttr (const wxString &name, int value) |
virtual void | WriteAttr (const wxString &name, bool value) |
virtual void | WriteAttr (const wxString &name, long value) |
virtual void | WriteAttr (const wxString &name, long long value) |
virtual void | WriteAttr (const wxString &name, size_t value) |
virtual void | WriteAttr (const wxString &name, float value, int digits=-1) |
virtual void | WriteAttr (const wxString &name, double value, int digits=-1) |
virtual void | WriteData (const wxString &value) |
virtual void | WriteSubTree (const wxString &value) |
virtual void | Write (const wxString &data)=0 |
Static Public Member Functions | |
static TranslatableString | FailureMessage (const FilePath &filePath) |
static bool | Decode (BufferedStreamReader &in, XMLTagHandler *handler) |
Private Member Functions | |
void | WriteName (const wxString &name) |
Private Attributes | |
MemoryStream | mBuffer |
bool | mDictChanged |
Static Private Attributes | |
static NameMap | mNames |
static MemoryStream | mDict |
Additional Inherited Members | |
Protected Attributes inherited from XMLWriter | |
bool | mInTag |
int | mDepth |
wxArrayString | mTagstack |
std::vector< int > | mHasKids |
a class used to (de)serialize the project catalog
Definition at line 36 of file ProjectSerializer.h.
ProjectSerializer::ProjectSerializer | ( | size_t | allocSize = 1024 * 1024 | ) |
Definition at line 350 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), MemoryStream::AppendData(), flag, FT_CharSize, mDict, mDictChanged, and size.
|
virtual |
Definition at line 366 of file ProjectSerializer.cpp.
|
static |
Definition at line 523 of file ProjectSerializer.cpp.
References Error, FT_Bool, FT_CharSize, FT_Data, FT_Double, FT_EndTag, FT_Float, FT_Int, FT_Long, FT_LongLong, FT_Name, FT_Pop, FT_Push, FT_Raw, FT_SizeT, FT_StartTag, FT_String, audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, id, NumericConverterFormats::Lookup(), BufferedStreamReader::Read(), anonymous_namespace{ProjectSerializer.cpp}::ReadDigits, anonymous_namespace{ProjectSerializer.cpp}::ReadInt, anonymous_namespace{ProjectSerializer.cpp}::ReadLength, anonymous_namespace{ProjectSerializer.cpp}::ReadLong, anonymous_namespace{ProjectSerializer.cpp}::ReadLongLong, anonymous_namespace{ProjectSerializer.cpp}::ReadULong, anonymous_namespace{ProjectSerializer.cpp}::ReadUShort, and wxT().
Referenced by ProjectFileIO::LoadProject().
bool ProjectSerializer::DictChanged | ( | ) | const |
Definition at line 517 of file ProjectSerializer.cpp.
References mDictChanged.
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 376 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), FT_EndTag, mBuffer, name, and WriteName().
|
static |
Definition at line 90 of file ProjectSerializer.cpp.
References XO().
const MemoryStream & ProjectSerializer::GetData | ( | ) | const |
Definition at line 507 of file ProjectSerializer.cpp.
References mBuffer.
Referenced by audacity::cloud::audiocom::sync::ProjectCloudExtension::OnUpdateSaved(), and ProjectFileIO::WriteDoc().
const MemoryStream & ProjectSerializer::GetDict | ( | ) | const |
Definition at line 502 of file ProjectSerializer.cpp.
References mDict.
Referenced by audacity::cloud::audiocom::sync::ProjectCloudExtension::OnUpdateSaved(), and ProjectFileIO::WriteDoc().
bool ProjectSerializer::IsEmpty | ( | ) | const |
Definition at line 512 of file ProjectSerializer.cpp.
References MemoryStream::GetSize(), and mBuffer.
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 370 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), FT_StartTag, mBuffer, name, and WriteName().
|
overridevirtual |
Implements XMLWriter.
Definition at line 464 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), MemoryStream::AppendData(), FT_Raw, mBuffer, and anonymous_namespace{ProjectSerializer.cpp}::WriteLength.
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 405 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), FT_Bool, mBuffer, name, and WriteName().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 382 of file ProjectSerializer.cpp.
References name, and WriteAttr().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 387 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), MemoryStream::AppendData(), FT_String, mBuffer, name, anonymous_namespace{ProjectSerializer.cpp}::WriteLength, and WriteName().
Referenced by WriteAttr().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 446 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), MemoryStream::AppendData(), FT_Double, mBuffer, name, anonymous_namespace{ProjectSerializer.cpp}::WriteDigits, and WriteName().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 437 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), MemoryStream::AppendData(), FT_Float, mBuffer, name, anonymous_namespace{ProjectSerializer.cpp}::WriteDigits, and WriteName().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 397 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), FT_Int, mBuffer, name, anonymous_namespace{ProjectSerializer.cpp}::WriteInt, and WriteName().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 421 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), FT_LongLong, mBuffer, name, anonymous_namespace{ProjectSerializer.cpp}::WriteLongLong, and WriteName().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 413 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), FT_Long, mBuffer, name, anonymous_namespace{ProjectSerializer.cpp}::WriteLong, and WriteName().
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 429 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), FT_SizeT, mBuffer, name, WriteName(), and anonymous_namespace{ProjectSerializer.cpp}::WriteULong.
|
overridevirtual |
Reimplemented from XMLWriter.
Definition at line 455 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), MemoryStream::AppendData(), FT_Data, mBuffer, and anonymous_namespace{ProjectSerializer.cpp}::WriteLength.
|
private |
Definition at line 472 of file ProjectSerializer.cpp.
References MemoryStream::AppendByte(), MemoryStream::AppendData(), FT_Name, id, mBuffer, mDict, mDictChanged, mNames, name, and anonymous_namespace{ProjectSerializer.cpp}::WriteUShort.
Referenced by EndTag(), StartTag(), and WriteAttr().
|
private |
Definition at line 75 of file ProjectSerializer.h.
Referenced by EndTag(), GetData(), IsEmpty(), StartTag(), Write(), WriteAttr(), WriteData(), and WriteName().
|
staticprivate |
Definition at line 79 of file ProjectSerializer.h.
Referenced by GetDict(), ProjectSerializer(), and WriteName().
|
private |
Definition at line 76 of file ProjectSerializer.h.
Referenced by DictChanged(), ProjectSerializer(), and WriteName().
|
staticprivate |
Definition at line 78 of file ProjectSerializer.h.
Referenced by WriteName().