1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-21 17:47:13 +02:00

Integrate XML module.

Integrate the XML module into the host plugin and get it to compile.
This commit is contained in:
Sandu Liviu Catalin
2020-03-22 01:33:11 +02:00
parent de3f365522
commit 39d6af7687
18 changed files with 2961 additions and 135 deletions

@ -37,7 +37,7 @@ void IniResult::Check() const
}
// ------------------------------------------------------------------------------------------------
void DocumentRef::Validate() const
void IniDocumentRef::Validate() const
{
// Is the document handle valid?
if (!m_Ptr)
@ -47,7 +47,7 @@ void DocumentRef::Validate() const
}
// ------------------------------------------------------------------------------------------------
Int32 Entries::Cmp(const Entries & o) const
Int32 IniEntries::Cmp(const IniEntries & o) const
{
if (m_Elem == o.m_Elem)
{
@ -64,7 +64,7 @@ Int32 Entries::Cmp(const Entries & o) const
}
// ------------------------------------------------------------------------------------------------
void Entries::Next()
void IniEntries::Next()
{
// Are there any other elements ahead?
if (!m_List.empty() && m_Elem != m_List.end())
@ -74,7 +74,7 @@ void Entries::Next()
}
// ------------------------------------------------------------------------------------------------
void Entries::Prev()
void IniEntries::Prev()
{
// Are there any other elements behind?
if (!m_List.empty() && m_Elem != m_List.begin())
@ -84,7 +84,7 @@ void Entries::Prev()
}
// ------------------------------------------------------------------------------------------------
void Entries::Advance(Int32 n)
void IniEntries::Advance(Int32 n)
{
// Are there any other elements ahead?
if (m_List.empty() || m_Elem == m_List.end())
@ -99,7 +99,7 @@ void Entries::Advance(Int32 n)
}
// ------------------------------------------------------------------------------------------------
void Entries::Retreat(Int32 n)
void IniEntries::Retreat(Int32 n)
{
// Are there any other elements behind?
if (m_List.empty() || m_Elem == m_List.begin())
@ -114,7 +114,7 @@ void Entries::Retreat(Int32 n)
}
// ------------------------------------------------------------------------------------------------
CSStr Entries::GetItem() const
CSStr IniEntries::GetItem() const
{
// is the current element valid?
if (m_List.empty() || m_Elem == m_List.end())
@ -126,7 +126,7 @@ CSStr Entries::GetItem() const
}
// ------------------------------------------------------------------------------------------------
CSStr Entries::GetComment() const
CSStr IniEntries::GetComment() const
{
// is the current element valid?
if (m_List.empty() || m_Elem == m_List.end())
@ -138,7 +138,7 @@ CSStr Entries::GetComment() const
}
// ------------------------------------------------------------------------------------------------
Int32 Entries::GetOrder() const
Int32 IniEntries::GetOrder() const
{
// is the current element valid?
if (m_List.empty() || m_Elem == m_List.end())
@ -150,7 +150,7 @@ Int32 Entries::GetOrder() const
}
// ------------------------------------------------------------------------------------------------
Int32 Document::Cmp(const Document & o) const
Int32 IniDocument::Cmp(const IniDocument & o) const
{
if (m_Doc == o.m_Doc)
{
@ -167,7 +167,7 @@ Int32 Document::Cmp(const Document & o) const
}
// ------------------------------------------------------------------------------------------------
IniResult Document::LoadFile(CSStr filepath)
IniResult IniDocument::LoadFile(CSStr filepath)
{
// Validate the handle
m_Doc.Validate();
@ -176,7 +176,7 @@ IniResult Document::LoadFile(CSStr filepath)
}
// ------------------------------------------------------------------------------------------------
IniResult Document::LoadData(CSStr source, Int32 size)
IniResult IniDocument::LoadData(CSStr source, Int32 size)
{
// Validate the handle
m_Doc.Validate();
@ -185,7 +185,7 @@ IniResult Document::LoadData(CSStr source, Int32 size)
}
// ------------------------------------------------------------------------------------------------
IniResult Document::SaveFile(CSStr filepath, bool signature)
IniResult IniDocument::SaveFile(CSStr filepath, bool signature)
{
// Validate the handle
m_Doc.Validate();
@ -194,7 +194,7 @@ IniResult Document::SaveFile(CSStr filepath, bool signature)
}
// ------------------------------------------------------------------------------------------------
Object Document::SaveData(bool signature)
Object IniDocument::SaveData(bool signature)
{
// Validate the handle
m_Doc.Validate();
@ -214,7 +214,7 @@ Object Document::SaveData(bool signature)
}
// ------------------------------------------------------------------------------------------------
Entries Document::GetAllSections() const
IniEntries IniDocument::GetAllSections() const
{
// Validate the handle
m_Doc.Validate();
@ -223,11 +223,11 @@ Entries Document::GetAllSections() const
// Obtain all sections from the INI document
m_Doc->GetAllSections(entries);
// Return the entries and take over content
return Entries(m_Doc, entries);
return IniEntries(m_Doc, entries);
}
// ------------------------------------------------------------------------------------------------
Entries Document::GetAllKeys(CSStr section) const
IniEntries IniDocument::GetAllKeys(CSStr section) const
{
// Validate the handle
m_Doc.Validate();
@ -236,11 +236,11 @@ Entries Document::GetAllKeys(CSStr section) const
// Obtain all sections from the INI document
m_Doc->GetAllKeys(section, entries);
// Return the entries and take over content
return Entries(m_Doc, entries);
return IniEntries(m_Doc, entries);
}
// ------------------------------------------------------------------------------------------------
Entries Document::GetAllValues(CSStr section, CSStr key) const
IniEntries IniDocument::GetAllValues(CSStr section, CSStr key) const
{
// Validate the handle
m_Doc.Validate();
@ -249,11 +249,11 @@ Entries Document::GetAllValues(CSStr section, CSStr key) const
// Obtain all sections from the INI document
m_Doc->GetAllValues(section, key, entries);
// Return the entries and take over content
return Entries(m_Doc, entries);
return IniEntries(m_Doc, entries);
}
// ------------------------------------------------------------------------------------------------
Int32 Document::GetSectionSize(CSStr section) const
Int32 IniDocument::GetSectionSize(CSStr section) const
{
// Validate the handle
m_Doc.Validate();
@ -262,7 +262,7 @@ Int32 Document::GetSectionSize(CSStr section) const
}
// ------------------------------------------------------------------------------------------------
bool Document::HasMultipleKeys(CSStr section, CSStr key) const
bool IniDocument::HasMultipleKeys(CSStr section, CSStr key) const
{
// Validate the handle
m_Doc.Validate();
@ -278,7 +278,7 @@ bool Document::HasMultipleKeys(CSStr section, CSStr key) const
}
// ------------------------------------------------------------------------------------------------
CCStr Document::GetValue(CSStr section, CSStr key, CSStr def) const
CCStr IniDocument::GetValue(CSStr section, CSStr key, CSStr def) const
{
// Validate the handle
m_Doc.Validate();
@ -287,7 +287,7 @@ CCStr Document::GetValue(CSStr section, CSStr key, CSStr def) const
}
// ------------------------------------------------------------------------------------------------
SQInteger Document::GetInteger(CSStr section, CSStr key, SQInteger def) const
SQInteger IniDocument::GetInteger(CSStr section, CSStr key, SQInteger def) const
{
// Validate the handle
m_Doc.Validate();
@ -296,7 +296,7 @@ SQInteger Document::GetInteger(CSStr section, CSStr key, SQInteger def) const
}
// ------------------------------------------------------------------------------------------------
SQFloat Document::GetFloat(CSStr section, CSStr key, SQFloat def) const
SQFloat IniDocument::GetFloat(CSStr section, CSStr key, SQFloat def) const
{
// Validate the handle
m_Doc.Validate();
@ -305,7 +305,7 @@ SQFloat Document::GetFloat(CSStr section, CSStr key, SQFloat def) const
}
// ------------------------------------------------------------------------------------------------
bool Document::GetBoolean(CSStr section, CSStr key, bool def) const
bool IniDocument::GetBoolean(CSStr section, CSStr key, bool def) const
{
// Validate the handle
m_Doc.Validate();
@ -314,7 +314,7 @@ bool Document::GetBoolean(CSStr section, CSStr key, bool def) const
}
// ------------------------------------------------------------------------------------------------
IniResult Document::SetValue(CSStr section, CSStr key, CSStr value, bool force, CSStr comment)
IniResult IniDocument::SetValue(CSStr section, CSStr key, CSStr value, bool force, CSStr comment)
{
// Validate the handle
m_Doc.Validate();
@ -323,7 +323,7 @@ IniResult Document::SetValue(CSStr section, CSStr key, CSStr value, bool force,
}
// ------------------------------------------------------------------------------------------------
IniResult Document::SetInteger(CSStr section, CSStr key, SQInteger value, bool hex, bool force, CSStr comment)
IniResult IniDocument::SetInteger(CSStr section, CSStr key, SQInteger value, bool hex, bool force, CSStr comment)
{
// Validate the handle
m_Doc.Validate();
@ -332,7 +332,7 @@ IniResult Document::SetInteger(CSStr section, CSStr key, SQInteger value, bool h
}
// ------------------------------------------------------------------------------------------------
IniResult Document::SetFloat(CSStr section, CSStr key, SQFloat value, bool force, CSStr comment)
IniResult IniDocument::SetFloat(CSStr section, CSStr key, SQFloat value, bool force, CSStr comment)
{
// Validate the handle
m_Doc.Validate();
@ -341,7 +341,7 @@ IniResult Document::SetFloat(CSStr section, CSStr key, SQFloat value, bool force
}
// ------------------------------------------------------------------------------------------------
IniResult Document::SetBoolean(CSStr section, CSStr key, bool value, bool force, CSStr comment)
IniResult IniDocument::SetBoolean(CSStr section, CSStr key, bool value, bool force, CSStr comment)
{
// Validate the handle
m_Doc.Validate();
@ -350,7 +350,7 @@ IniResult Document::SetBoolean(CSStr section, CSStr key, bool value, bool force,
}
// ------------------------------------------------------------------------------------------------
bool Document::DeleteValue(CSStr section, CSStr key, CSStr value, bool empty)
bool IniDocument::DeleteValue(CSStr section, CSStr key, CSStr value, bool empty)
{
// Validate the handle
m_Doc.Validate();
@ -381,36 +381,36 @@ void Register_INI(HSQUIRRELVM vm)
.Func(_SC("Check"), &IniResult::Check)
);
inins.Bind(_SC("Entries"),
Class< Entries >(vm, EntriesTypename::Str)
inins.Bind(_SC("IniEntries"),
Class< IniEntries >(vm, EntriesTypename::Str)
// Constructors
.Ctor()
.Ctor< const Entries & >()
.Ctor< const IniEntries & >()
// Core Meta-methods
.SquirrelFunc(_SC("_typename"), &EntriesTypename::Fn)
.Func(_SC("_tostring"), &Entries::ToString)
.Func(_SC("cmp"), &Entries::Cmp)
.Func(_SC("_tostring"), &IniEntries::ToString)
.Func(_SC("cmp"), &IniEntries::Cmp)
// Properties
.Prop(_SC("Valid"), &Entries::IsValid)
.Prop(_SC("Empty"), &Entries::IsEmpty)
.Prop(_SC("References"), &Entries::GetRefCount)
.Prop(_SC("Size"), &Entries::GetSize)
.Prop(_SC("Item"), &Entries::GetItem)
.Prop(_SC("Comment"), &Entries::GetComment)
.Prop(_SC("Order"), &Entries::GetOrder)
.Prop(_SC("Valid"), &IniEntries::IsValid)
.Prop(_SC("Empty"), &IniEntries::IsEmpty)
.Prop(_SC("References"), &IniEntries::GetRefCount)
.Prop(_SC("Size"), &IniEntries::GetSize)
.Prop(_SC("Item"), &IniEntries::GetItem)
.Prop(_SC("Comment"), &IniEntries::GetComment)
.Prop(_SC("Order"), &IniEntries::GetOrder)
// Member Methods
.Func(_SC("Reset"), &Entries::Reset)
.Func(_SC("Next"), &Entries::Next)
.Func(_SC("Prev"), &Entries::Prev)
.Func(_SC("Advance"), &Entries::Advance)
.Func(_SC("Retreat"), &Entries::Retreat)
.Func(_SC("Sort"), &Entries::Sort)
.Func(_SC("SortByKeyOrder"), &Entries::SortByKeyOrder)
.Func(_SC("SortByLoadOrder"), &Entries::SortByLoadOrder)
.Func(_SC("Reset"), &IniEntries::Reset)
.Func(_SC("Next"), &IniEntries::Next)
.Func(_SC("Prev"), &IniEntries::Prev)
.Func(_SC("Advance"), &IniEntries::Advance)
.Func(_SC("Retreat"), &IniEntries::Retreat)
.Func(_SC("Sort"), &IniEntries::Sort)
.Func(_SC("SortByKeyOrder"), &IniEntries::SortByKeyOrder)
.Func(_SC("SortByLoadOrder"), &IniEntries::SortByLoadOrder)
);
inins.Bind(_SC("Document"),
Class< Document, NoCopy< Document > >(vm, DocumentTypename::Str)
inins.Bind(_SC("IniDocument"),
Class< IniDocument, NoCopy< IniDocument > >(vm, DocumentTypename::Str)
// Constructors
.Ctor()
.Ctor< bool >()
@ -418,50 +418,50 @@ void Register_INI(HSQUIRRELVM vm)
.Ctor< bool, bool, bool >()
// Core Meta-methods
.SquirrelFunc(_SC("_typename"), &DocumentTypename::Fn)
.Func(_SC("_tostring"), &Document::ToString)
.Func(_SC("cmp"), &Document::Cmp)
.Func(_SC("_tostring"), &IniDocument::ToString)
.Func(_SC("cmp"), &IniDocument::Cmp)
// Properties
.Prop(_SC("Valid"), &Document::IsValid)
.Prop(_SC("Empty"), &Document::IsEmpty)
.Prop(_SC("References"), &Document::GetRefCount)
.Prop(_SC("Unicode"), &Document::GetUnicode, &Document::SetUnicode)
.Prop(_SC("MultiKey"), &Document::GetMultiKey, &Document::SetMultiKey)
.Prop(_SC("MultiLine"), &Document::GetMultiLine, &Document::SetMultiLine)
.Prop(_SC("Spaces"), &Document::GetSpaces, &Document::SetSpaces)
.Prop(_SC("Valid"), &IniDocument::IsValid)
.Prop(_SC("Empty"), &IniDocument::IsEmpty)
.Prop(_SC("References"), &IniDocument::GetRefCount)
.Prop(_SC("Unicode"), &IniDocument::GetUnicode, &IniDocument::SetUnicode)
.Prop(_SC("MultiKey"), &IniDocument::GetMultiKey, &IniDocument::SetMultiKey)
.Prop(_SC("MultiLine"), &IniDocument::GetMultiLine, &IniDocument::SetMultiLine)
.Prop(_SC("Spaces"), &IniDocument::GetSpaces, &IniDocument::SetSpaces)
// Member Methods
.Func(_SC("Reset"), &Document::Reset)
.Func(_SC("LoadFile"), &Document::LoadFile)
.Overload< IniResult (Document::*)(CSStr) >(_SC("LoadString"), &Document::LoadData)
.Overload< IniResult (Document::*)(CSStr, Int32) >(_SC("LoadString"), &Document::LoadData)
.Overload< IniResult (Document::*)(CSStr) >(_SC("SaveFile"), &Document::SaveFile)
.Overload< IniResult (Document::*)(CSStr, bool) >(_SC("SaveFile"), &Document::SaveFile)
.Func(_SC("SaveData"), &Document::SaveData)
.Func(_SC("GetSections"), &Document::GetAllSections)
.Func(_SC("GetKeys"), &Document::GetAllKeys)
.Func(_SC("GetValues"), &Document::GetAllValues)
.Func(_SC("GetSectionSize"), &Document::GetSectionSize)
.Func(_SC("HasMultipleKeys"), &Document::HasMultipleKeys)
.Func(_SC("GetValue"), &Document::GetValue)
.Func(_SC("GetInteger"), &Document::GetInteger)
.Func(_SC("GetFloat"), &Document::GetFloat)
.Func(_SC("GetBoolean"), &Document::GetBoolean)
.Overload< IniResult (Document::*)(CSStr, CSStr, CSStr) >(_SC("SetValue"), &Document::SetValue)
.Overload< IniResult (Document::*)(CSStr, CSStr, CSStr, bool) >(_SC("SetValue"), &Document::SetValue)
.Overload< IniResult (Document::*)(CSStr, CSStr, CSStr, bool, CSStr) >(_SC("SetValue"), &Document::SetValue)
.Overload< IniResult (Document::*)(CSStr, CSStr, SQInteger) >(_SC("SetInteger"), &Document::SetInteger)
.Overload< IniResult (Document::*)(CSStr, CSStr, SQInteger, bool) >(_SC("SetInteger"), &Document::SetInteger)
.Overload< IniResult (Document::*)(CSStr, CSStr, SQInteger, bool, bool) >(_SC("SetInteger"), &Document::SetInteger)
.Overload< IniResult (Document::*)(CSStr, CSStr, SQInteger, bool, bool, CSStr) >(_SC("SetInteger"), &Document::SetInteger)
.Overload< IniResult (Document::*)(CSStr, CSStr, SQFloat) >(_SC("SetFloat"), &Document::SetFloat)
.Overload< IniResult (Document::*)(CSStr, CSStr, SQFloat, bool) >(_SC("SetFloat"), &Document::SetFloat)
.Overload< IniResult (Document::*)(CSStr, CSStr, SQFloat, bool, CSStr) >(_SC("SetFloat"), &Document::SetFloat)
.Overload< IniResult (Document::*)(CSStr, CSStr, bool) >(_SC("SetBoolean"), &Document::SetBoolean)
.Overload< IniResult (Document::*)(CSStr, CSStr, bool, bool) >(_SC("SetBoolean"), &Document::SetBoolean)
.Overload< IniResult (Document::*)(CSStr, CSStr, bool, bool, CSStr) >(_SC("SetBoolean"), &Document::SetBoolean)
.Overload< bool (Document::*)(CSStr) >(_SC("DeleteValue"), &Document::DeleteValue)
.Overload< bool (Document::*)(CSStr, CSStr) >(_SC("DeleteValue"), &Document::DeleteValue)
.Overload< bool (Document::*)(CSStr, CSStr, CSStr) >(_SC("DeleteValue"), &Document::DeleteValue)
.Overload< bool (Document::*)(CSStr, CSStr, CSStr, bool) >(_SC("DeleteValue"), &Document::DeleteValue)
.Func(_SC("Reset"), &IniDocument::Reset)
.Func(_SC("LoadFile"), &IniDocument::LoadFile)
.Overload< IniResult (IniDocument::*)(CSStr) >(_SC("LoadString"), &IniDocument::LoadData)
.Overload< IniResult (IniDocument::*)(CSStr, Int32) >(_SC("LoadString"), &IniDocument::LoadData)
.Overload< IniResult (IniDocument::*)(CSStr) >(_SC("SaveFile"), &IniDocument::SaveFile)
.Overload< IniResult (IniDocument::*)(CSStr, bool) >(_SC("SaveFile"), &IniDocument::SaveFile)
.Func(_SC("SaveData"), &IniDocument::SaveData)
.Func(_SC("GetSections"), &IniDocument::GetAllSections)
.Func(_SC("GetKeys"), &IniDocument::GetAllKeys)
.Func(_SC("GetValues"), &IniDocument::GetAllValues)
.Func(_SC("GetSectionSize"), &IniDocument::GetSectionSize)
.Func(_SC("HasMultipleKeys"), &IniDocument::HasMultipleKeys)
.Func(_SC("GetValue"), &IniDocument::GetValue)
.Func(_SC("GetInteger"), &IniDocument::GetInteger)
.Func(_SC("GetFloat"), &IniDocument::GetFloat)
.Func(_SC("GetBoolean"), &IniDocument::GetBoolean)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, CSStr) >(_SC("SetValue"), &IniDocument::SetValue)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, CSStr, bool) >(_SC("SetValue"), &IniDocument::SetValue)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, CSStr, bool, CSStr) >(_SC("SetValue"), &IniDocument::SetValue)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, SQInteger) >(_SC("SetInteger"), &IniDocument::SetInteger)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, SQInteger, bool) >(_SC("SetInteger"), &IniDocument::SetInteger)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, SQInteger, bool, bool) >(_SC("SetInteger"), &IniDocument::SetInteger)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, SQInteger, bool, bool, CSStr) >(_SC("SetInteger"), &IniDocument::SetInteger)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, SQFloat) >(_SC("SetFloat"), &IniDocument::SetFloat)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, SQFloat, bool) >(_SC("SetFloat"), &IniDocument::SetFloat)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, SQFloat, bool, CSStr) >(_SC("SetFloat"), &IniDocument::SetFloat)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, bool) >(_SC("SetBoolean"), &IniDocument::SetBoolean)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, bool, bool) >(_SC("SetBoolean"), &IniDocument::SetBoolean)
.Overload< IniResult (IniDocument::*)(CSStr, CSStr, bool, bool, CSStr) >(_SC("SetBoolean"), &IniDocument::SetBoolean)
.Overload< bool (IniDocument::*)(CSStr) >(_SC("DeleteValue"), &IniDocument::DeleteValue)
.Overload< bool (IniDocument::*)(CSStr, CSStr) >(_SC("DeleteValue"), &IniDocument::DeleteValue)
.Overload< bool (IniDocument::*)(CSStr, CSStr, CSStr) >(_SC("DeleteValue"), &IniDocument::DeleteValue)
.Overload< bool (IniDocument::*)(CSStr, CSStr, CSStr, bool) >(_SC("DeleteValue"), &IniDocument::DeleteValue)
);
RootTable(vm).Bind(_SC("SqIni"), inins);

@ -171,10 +171,10 @@ public:
/* ------------------------------------------------------------------------------------------------
* Manages a reference counted INI document instance.
*/
class DocumentRef
class IniDocumentRef
{
// --------------------------------------------------------------------------------------------
friend class Document;
friend class IniDocument;
public:
@ -231,7 +231,7 @@ private:
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
DocumentRef(bool utf8, bool multikey, bool multiline)
IniDocumentRef(bool utf8, bool multikey, bool multiline)
: m_Ptr(new Type(utf8, multikey, multiline)), m_Ref(new Counter(1))
{
/* ... */
@ -242,7 +242,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Default constructor (null).
*/
DocumentRef()
IniDocumentRef()
: m_Ptr(NULL), m_Ref(NULL)
{
/* ... */
@ -251,7 +251,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Copy constructor.
*/
DocumentRef(const DocumentRef & o)
IniDocumentRef(const IniDocumentRef & o)
: m_Ptr(o.m_Ptr), m_Ref(o.m_Ref)
{
@ -261,7 +261,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Move constructor.
*/
DocumentRef(DocumentRef && o)
IniDocumentRef(IniDocumentRef && o)
: m_Ptr(o.m_Ptr), m_Ref(o.m_Ref)
{
@ -272,7 +272,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~DocumentRef()
~IniDocumentRef()
{
Drop();
}
@ -280,7 +280,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Copy assignment operator.
*/
DocumentRef & operator = (const DocumentRef & o)
IniDocumentRef & operator = (const IniDocumentRef & o)
{
if (m_Ptr != o.m_Ptr)
{
@ -295,7 +295,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Move assignment operator.
*/
DocumentRef & operator = (DocumentRef && o)
IniDocumentRef & operator = (IniDocumentRef && o)
{
if (m_Ptr != o.m_Ptr)
{
@ -310,7 +310,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Perform an equality comparison between two document instances.
*/
bool operator == (const DocumentRef & o) const
bool operator == (const IniDocumentRef & o) const
{
return (m_Ptr == o.m_Ptr);
}
@ -318,7 +318,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Perform an inequality comparison between two document instances.
*/
bool operator != (const DocumentRef & o) const
bool operator != (const IniDocumentRef & o) const
{
return (m_Ptr != o.m_Ptr);
}
@ -395,15 +395,15 @@ public:
/* ------------------------------------------------------------------------------------------------
* Class that can access and iterate a series of entries in the INI document.
*/
class Entries
class IniEntries
{
// --------------------------------------------------------------------------------------------
friend class Document;
friend class IniDocument;
protected:
// --------------------------------------------------------------------------------------------
typedef DocumentRef::Type::TNamesDepend Container;
typedef IniDocumentRef::Type::TNamesDepend Container;
// --------------------------------------------------------------------------------------------
typedef Container::iterator Iterator;
@ -411,7 +411,7 @@ protected:
/* --------------------------------------------------------------------------------------------
* Default constructor.
*/
Entries(const DocumentRef & ini, Container & list)
IniEntries(const IniDocumentRef & ini, Container & list)
: m_Doc(ini), m_List(), m_Elem()
{
m_List.swap(list);
@ -421,7 +421,7 @@ protected:
private:
// ---------------------------------------------------------------------------------------------
DocumentRef m_Doc; // The document that contains the elements.
IniDocumentRef m_Doc; // The document that contains the elements.
Container m_List; // The list of elements to iterate.
Iterator m_Elem; // The currently processed element.
@ -430,7 +430,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Default constructor. (null)
*/
Entries()
IniEntries()
: m_Doc(), m_List(), m_Elem(m_List.end())
{
/* ... */
@ -439,7 +439,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Copy constructor.
*/
Entries(const Entries & o)
IniEntries(const IniEntries & o)
: m_Doc(o.m_Doc), m_List(o.m_List), m_Elem()
{
Reset();
@ -448,7 +448,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~Entries()
~IniEntries()
{
/* ... */
}
@ -456,7 +456,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Copy assignment operator.
*/
Entries & operator = (const Entries & o)
IniEntries & operator = (const IniEntries & o)
{
m_Doc = o.m_Doc;
m_List = o.m_List;
@ -467,7 +467,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare two instances of this type.
*/
Int32 Cmp(const Entries & o) const;
Int32 Cmp(const IniEntries & o) const;
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
@ -551,7 +551,7 @@ public:
{
if (!m_List.empty())
{
m_List.sort(DocumentRef::Type::Entry::KeyOrder());
m_List.sort(IniDocumentRef::Type::Entry::KeyOrder());
}
}
@ -562,7 +562,7 @@ public:
{
if (!m_List.empty())
{
m_List.sort(DocumentRef::Type::Entry::KeyOrder());
m_List.sort(IniDocumentRef::Type::Entry::KeyOrder());
}
}
@ -573,7 +573,7 @@ public:
{
if (!m_List.empty())
{
m_List.sort(DocumentRef::Type::Entry::LoadOrder());
m_List.sort(IniDocumentRef::Type::Entry::LoadOrder());
}
}
@ -596,34 +596,34 @@ public:
/* ------------------------------------------------------------------------------------------------
* Class that can read/write and alter the contents of INI files.
*/
class Document
class IniDocument
{
protected:
// --------------------------------------------------------------------------------------------
typedef DocumentRef::Type::TNamesDepend Container;
typedef IniDocumentRef::Type::TNamesDepend Container;
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
*/
Document(const Document & o);
IniDocument(const IniDocument & o);
/* --------------------------------------------------------------------------------------------
* Copy assignment operator. (disabled)
*/
Document & operator = (const Document & o);
IniDocument & operator = (const IniDocument & o);
private:
// ---------------------------------------------------------------------------------------------
DocumentRef m_Doc; // The main INI document instance.
IniDocumentRef m_Doc; // The main INI document instance.
public:
/* --------------------------------------------------------------------------------------------
* Default constructor.
*/
Document()
IniDocument()
: m_Doc(false, false, true)
{
/* ... */
@ -632,7 +632,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Explicit constructor.
*/
Document(bool utf8)
IniDocument(bool utf8)
: m_Doc(utf8, false, true)
{
/* ... */
@ -641,7 +641,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Explicit constructor.
*/
Document(bool utf8, bool multikey)
IniDocument(bool utf8, bool multikey)
: m_Doc(utf8, multikey, true)
{
/* ... */
@ -650,7 +650,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Explicit constructor.
*/
Document(bool utf8, bool multikey, bool multiline)
IniDocument(bool utf8, bool multikey, bool multiline)
: m_Doc(utf8, multikey, multiline)
{
/* ... */
@ -659,7 +659,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~Document()
~IniDocument()
{
/* ... */
}
@ -667,7 +667,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare two instances of this type.
*/
Int32 Cmp(const Document & o) const;
Int32 Cmp(const IniDocument & o) const;
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
@ -812,17 +812,17 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve all section names.
*/
Entries GetAllSections() const;
IniEntries GetAllSections() const;
/* --------------------------------------------------------------------------------------------
* Retrieve all unique key names in a section.
*/
Entries GetAllKeys(CSStr section) const;
IniEntries GetAllKeys(CSStr section) const;
/* --------------------------------------------------------------------------------------------
* Retrieve all values for a specific key.
*/
Entries GetAllValues(CSStr section, CSStr key) const;
IniEntries GetAllValues(CSStr section, CSStr key) const;
/* --------------------------------------------------------------------------------------------
* Query the number of keys in a specific section.