SAGA API Version 9.14
Loading...
Searching...
No Matches
CSG_MetaData Class Reference

#include <metadata.h>

Public Member Functions

 CSG_MetaData (void)
bool Create (void)
 CSG_MetaData (const CSG_MetaData &MetaData)
bool Create (const CSG_MetaData &MetaData)
 CSG_MetaData (const CSG_String &File, const SG_Char *Extension=NULL)
bool Create (const CSG_String &File, const SG_Char *Extension=NULL)
 CSG_MetaData (CSG_File &File)
bool Create (CSG_File &File)
virtual ~CSG_MetaData (void)
void Destroy (void)
bool Load (const CSG_String &File, const SG_Char *Extension=NULL)
bool Save (const CSG_String &File, const SG_Char *Extension=NULL) const
bool Load (CSG_File &Stream)
bool Save (CSG_File &Stream) const
bool Load (class wxXmlNode *pNode)
bool Save (class wxXmlNode *pNode) const
bool Load_HTTP (const CSG_String &Server, const CSG_String &Path, const SG_Char *Username=NULL, const SG_Char *Password=NULL)
bool from_XML (const char *XML, size_t Length, const char *Encoding="UTF-8")
bool from_XML (const CSG_String &XML)
bool to_XML (CSG_String &XML) const
bool Load_JSON (const CSG_String &File)
bool Save_JSON (const CSG_String &File) const
bool from_JSON (const CSG_String &JSON)
bool to_JSON (CSG_String &JSON) const
bool Assign (const CSG_MetaData &MetaData, bool bAddChildren=true)
CSG_MetaData & operator= (const CSG_MetaData &MetaData)
CSG_MetaData & operator+= (const CSG_MetaData &MetaData)
void Set_Name (const CSG_String &Name)
bool Cmp_Name (const CSG_String &String, bool bNoCase=true) const
const CSG_String & Get_Name (void) const
const CSG_String & Get_Content (void) const
const SG_Char * Get_Content (int Index) const
const SG_Char * Get_Content (const CSG_String &Name) const
bool Get_Content (const CSG_String &Name, CSG_String &Value) const
bool Get_Content (const CSG_String &Name, double &Value) const
bool Get_Content (const CSG_String &Name, int &Value) const
bool Get_Content (const CSG_String &Name, sLong &Value) const
void Set_Content (const CSG_String &Content)
void Fmt_Content (const char *Format,...)
void Fmt_Content (const wchar_t *Format,...)
bool Cmp_Content (const CSG_String &String, bool bNoCase=false) const
CSG_MetaData * Get_Parent (void) const
int Get_Count (void) const
int Get_Children_Count (void) const
CSG_MetaData * Get_Child (int Index) const
CSG_MetaData * Get_Child (const CSG_String &Name) const
CSG_MetaData * Get_Child_by_JSON_Pointer (const CSG_String &JSON_Pointer) const
CSG_MetaData * Add_Child (void)
CSG_MetaData * Add_Child (const CSG_String &Name)
CSG_MetaData * Add_Child (const CSG_String &Name, const CSG_String &Content)
CSG_MetaData * Add_Child (const CSG_String &Name, double Content)
CSG_MetaData * Add_Child (const CSG_String &Name, int Content)
CSG_MetaData * Add_Child (const CSG_String &Name, sLong Content)
CSG_MetaData * Add_Child (const CSG_MetaData &MetaData, bool bAddChildren=true)
CSG_MetaData * Ins_Child (int Position)
CSG_MetaData * Ins_Child (const CSG_String &Name, int Position)
CSG_MetaData * Ins_Child (const CSG_String &Name, const CSG_String &Content, int Position)
CSG_MetaData * Ins_Child (const CSG_String &Name, double Content, int Position)
CSG_MetaData * Ins_Child (const CSG_String &Name, int Content, int Position)
CSG_MetaData * Ins_Child (const CSG_String &Name, sLong Content, int Position)
CSG_MetaData * Ins_Child (const CSG_MetaData &MetaData, int Position, bool bAddChildren=true)
bool Mov_Child (int from_Index, int to_Index)
bool Del_Child (int Index)
bool Del_Child (const CSG_String &Name)
bool Add_Children (const CSG_MetaData &MetaData)
bool Del_Children (int Depth=0, const SG_Char *Name=NULL)
CSG_MetaData * operator() (int Index) const
CSG_MetaData * operator() (const CSG_String &Name) const
CSG_MetaData & operator[] (int Index)
CSG_MetaData & operator[] (const CSG_String &Name)
const CSG_MetaData & operator[] (int Index) const
const CSG_MetaData & operator[] (const CSG_String &Name) const
int Get_Property_Count (void) const
const CSG_String & Get_Property_Name (int Index) const
const SG_Char * Get_Property (int Index) const
const SG_Char * Get_Property (const CSG_String &Name) const
bool Get_Property (const CSG_String &Name, CSG_String &Value) const
bool Get_Property (const CSG_String &Name, double &Value) const
bool Get_Property (const CSG_String &Name, int &Value) const
bool Get_Property (const CSG_String &Name, sLong &Value) const
bool Add_Property (const CSG_String &Name, const CSG_String &Value)
bool Add_Property (const CSG_String &Name, double Value)
bool Add_Property (const CSG_String &Name, int Value)
bool Add_Property (const CSG_String &Name, sLong Value)
bool Set_Property (const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
bool Set_Property (const CSG_String &Name, double Value, bool bAddIfNotExists=true)
bool Set_Property (const CSG_String &Name, int Value, bool bAddIfNotExists=true)
bool Set_Property (const CSG_String &Name, sLong Value, bool bAddIfNotExists=true)
bool Cmp_Property (const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const
bool Del_Property (const CSG_String &Name)
bool Del_Property (int i)
CSG_String asText (int Flags=0) const
class CSG_Table Get_Table (int Flags=0) const

Friends

class CSG_HTTP

Detailed Description

Definition at line 90 of file metadata.h.

Constructor & Destructor Documentation

◆ CSG_MetaData() [1/4]

◆ CSG_MetaData() [2/4]

CSG_MetaData::CSG_MetaData ( const CSG_MetaData & MetaData)

Definition at line 82 of file metadata.cpp.

References Create(), and CSG_MetaData().

◆ CSG_MetaData() [3/4]

CSG_MetaData::CSG_MetaData ( const CSG_String & File,
const SG_Char * Extension = NULL )

Definition at line 95 of file metadata.cpp.

References Create(), and SG_Char.

◆ CSG_MetaData() [4/4]

CSG_MetaData::CSG_MetaData ( CSG_File & File)

Definition at line 108 of file metadata.cpp.

References Create().

◆ ~CSG_MetaData()

CSG_MetaData::~CSG_MetaData ( void )
virtual

Definition at line 137 of file metadata.cpp.

References Destroy().

Member Function Documentation

◆ Add_Child() [1/7]

CSG_MetaData * CSG_MetaData::Add_Child ( const CSG_MetaData & MetaData,
bool bAddChildren = true )

Definition at line 199 of file metadata.cpp.

References CSG_MetaData(), and Ins_Child().

◆ Add_Child() [2/7]

CSG_MetaData * CSG_MetaData::Add_Child ( const CSG_String & Name)

Definition at line 174 of file metadata.cpp.

References CSG_MetaData(), and Ins_Child().

◆ Add_Child() [3/7]

CSG_MetaData * CSG_MetaData::Add_Child ( const CSG_String & Name,
const CSG_String & Content )

Definition at line 179 of file metadata.cpp.

References CSG_MetaData(), and Ins_Child().

◆ Add_Child() [4/7]

CSG_MetaData * CSG_MetaData::Add_Child ( const CSG_String & Name,
double Content )

Definition at line 184 of file metadata.cpp.

References CSG_MetaData(), Ins_Child(), and SG_Get_String().

◆ Add_Child() [5/7]

CSG_MetaData * CSG_MetaData::Add_Child ( const CSG_String & Name,
int Content )

Definition at line 189 of file metadata.cpp.

References CSG_MetaData(), CSG_String::Format(), Ins_Child(), and SG_T.

◆ Add_Child() [6/7]

CSG_MetaData * CSG_MetaData::Add_Child ( const CSG_String & Name,
sLong Content )

Definition at line 194 of file metadata.cpp.

References CSG_MetaData(), CSG_String::Format(), Ins_Child(), and SG_T.

◆ Add_Child() [7/7]

◆ Add_Children()

bool CSG_MetaData::Add_Children ( const CSG_MetaData & MetaData)

◆ Add_Property() [1/4]

◆ Add_Property() [2/4]

bool CSG_MetaData::Add_Property ( const CSG_String & Name,
double Value )

Definition at line 598 of file metadata.cpp.

References Add_Property(), CSG_String::Format(), and SG_T.

◆ Add_Property() [3/4]

bool CSG_MetaData::Add_Property ( const CSG_String & Name,
int Value )

Definition at line 603 of file metadata.cpp.

References Add_Property(), CSG_String::Format(), and SG_T.

◆ Add_Property() [4/4]

bool CSG_MetaData::Add_Property ( const CSG_String & Name,
sLong Value )

Definition at line 608 of file metadata.cpp.

References Add_Property(), CSG_String::Format(), and SG_T.

◆ Assign()

bool CSG_MetaData::Assign ( const CSG_MetaData & MetaData,
bool bAddChildren = true )

◆ asText()

CSG_String CSG_MetaData::asText ( int Flags = 0) const

◆ Cmp_Content()

bool CSG_MetaData::Cmp_Content ( const CSG_String & String,
bool bNoCase = false ) const

◆ Cmp_Name()

bool CSG_MetaData::Cmp_Name ( const CSG_String & String,
bool bNoCase = true ) const

◆ Cmp_Property()

bool CSG_MetaData::Cmp_Property ( const CSG_String & Name,
const CSG_String & String,
bool bNoCase = false ) const

◆ Create() [1/4]

bool CSG_MetaData::Create ( const CSG_MetaData & MetaData)

Definition at line 89 of file metadata.cpp.

References Assign(), and CSG_MetaData().

◆ Create() [2/4]

bool CSG_MetaData::Create ( const CSG_String & File,
const SG_Char * Extension = NULL )

Definition at line 102 of file metadata.cpp.

References Load(), and SG_Char.

◆ Create() [3/4]

bool CSG_MetaData::Create ( CSG_File & File)

Definition at line 115 of file metadata.cpp.

References Load().

◆ Create() [4/4]

bool CSG_MetaData::Create ( void )

◆ Del_Child() [1/2]

bool CSG_MetaData::Del_Child ( const CSG_String & Name)

◆ Del_Child() [2/2]

bool CSG_MetaData::Del_Child ( int Index)

Definition at line 324 of file metadata.cpp.

References CSG_MetaData(), and Get_Children_Count().

Referenced by Del_Child(), and Del_Children().

◆ Del_Children()

bool CSG_MetaData::Del_Children ( int Depth = 0,
const SG_Char * Name = NULL )

Deletes children if depth level is reached, i.e. if depth level equals zero all children of the node will be deleted, if it is one only the grandchildren will be affected, and so on. If Name is a valid string, only those children are taken into account that have this name.

Definition at line 384 of file metadata.cpp.

References Del_Child(), Del_Children(), Get_Child(), Get_Children_Count(), Get_Name(), and SG_Char.

Referenced by CSG_Grids::Create(), Del_Children(), CSG_Tool::Get_History(), and CSG_Table::Save().

◆ Del_Property() [1/2]

bool CSG_MetaData::Del_Property ( const CSG_String & Name)

Definition at line 614 of file metadata.cpp.

References Del_Property(), Get_Property_Count(), and Get_Property_Name().

Referenced by Del_Property().

◆ Del_Property() [2/2]

bool CSG_MetaData::Del_Property ( int i)

Definition at line 627 of file metadata.cpp.

References Get_Property_Count().

◆ Destroy()

◆ Fmt_Content() [1/2]

void CSG_MetaData::Fmt_Content ( const char * Format,
... )

◆ Fmt_Content() [2/2]

void CSG_MetaData::Fmt_Content ( const wchar_t * Format,
... )

Definition at line 555 of file metadata.cpp.

◆ from_JSON()

bool CSG_MetaData::from_JSON ( const CSG_String & JSON)

Definition at line 1130 of file metadata.cpp.

References Create(), Destroy(), JSON, and Set_Name().

Referenced by CSG_HTTP, and Load_JSON().

◆ from_XML() [1/2]

bool CSG_MetaData::from_XML ( const char * XML,
size_t Length,
const char * Encoding = "UTF-8" )

Definition at line 977 of file metadata.cpp.

References Destroy(), Length, and Load().

Referenced by CSG_HTTP.

◆ from_XML() [2/2]

bool CSG_MetaData::from_XML ( const CSG_String & XML)

Definition at line 998 of file metadata.cpp.

References CSG_String::c_str(), Destroy(), CSG_String::Length(), Load(), and SG_Char.

◆ Get_Child() [1/2]

CSG_MetaData * CSG_MetaData::Get_Child ( const CSG_String & Name) const

◆ Get_Child() [2/2]

◆ Get_Child_by_JSON_Pointer()

CSG_MetaData * CSG_MetaData::Get_Child_by_JSON_Pointer ( const CSG_String & JSON_Pointer) const

◆ Get_Children_Count()

◆ Get_Content() [1/7]

const SG_Char * CSG_MetaData::Get_Content ( const CSG_String & Name) const

◆ Get_Content() [2/7]

bool CSG_MetaData::Get_Content ( const CSG_String & Name,
CSG_String & Value ) const

Definition at line 511 of file metadata.cpp.

References CSG_String::c_str(), Get_Content(), CSG_String::is_Empty(), and SG_Char.

◆ Get_Content() [3/7]

bool CSG_MetaData::Get_Content ( const CSG_String & Name,
double & Value ) const

Definition at line 526 of file metadata.cpp.

References CSG_String::asDouble(), and Get_Content().

◆ Get_Content() [4/7]

bool CSG_MetaData::Get_Content ( const CSG_String & Name,
int & Value ) const

Definition at line 527 of file metadata.cpp.

References CSG_String::asInt(), and Get_Content().

◆ Get_Content() [5/7]

bool CSG_MetaData::Get_Content ( const CSG_String & Name,
sLong & Value ) const

Definition at line 528 of file metadata.cpp.

References CSG_String::asLongLong(), and Get_Content().

◆ Get_Content() [6/7]

const SG_Char * CSG_MetaData::Get_Content ( int Index) const
inline

Definition at line 140 of file metadata.h.

References Get_Child(), Get_Content(), and SG_Char.

Referenced by Get_Content().

◆ Get_Content() [7/7]

◆ Get_Count()

int CSG_MetaData::Get_Count ( void ) const
inline

Definition at line 153 of file metadata.h.

◆ Get_Name()

const CSG_String & CSG_MetaData::Get_Name ( void ) const
inline

◆ Get_Parent()

CSG_MetaData * CSG_MetaData::Get_Parent ( void ) const
inline

Definition at line 151 of file metadata.h.

References CSG_MetaData().

Referenced by to_JSON().

◆ Get_Property() [1/6]

const SG_Char * CSG_MetaData::Get_Property ( const CSG_String & Name) const
inline

Definition at line 189 of file metadata.h.

References Get_Property(), and SG_Char.

Referenced by Get_Property().

◆ Get_Property() [2/6]

bool CSG_MetaData::Get_Property ( const CSG_String & Name,
CSG_String & Value ) const

Definition at line 678 of file metadata.cpp.

References Get_Property(), and SG_Char.

◆ Get_Property() [3/6]

bool CSG_MetaData::Get_Property ( const CSG_String & Name,
double & Value ) const

Definition at line 692 of file metadata.cpp.

References CSG_String::asDouble(), and Get_Property().

◆ Get_Property() [4/6]

bool CSG_MetaData::Get_Property ( const CSG_String & Name,
int & Value ) const

Definition at line 693 of file metadata.cpp.

References CSG_String::asInt(), and Get_Property().

◆ Get_Property() [5/6]

bool CSG_MetaData::Get_Property ( const CSG_String & Name,
sLong & Value ) const

Definition at line 694 of file metadata.cpp.

References CSG_String::asLongLong(), and Get_Property().

◆ Get_Property() [6/6]

◆ Get_Property_Count()

int CSG_MetaData::Get_Property_Count ( void ) const
inline

Definition at line 186 of file metadata.h.

Referenced by Assign(), Del_Property(), Del_Property(), and Save().

◆ Get_Property_Name()

const CSG_String & CSG_MetaData::Get_Property_Name ( int Index) const
inline

Definition at line 187 of file metadata.h.

Referenced by Assign(), Del_Property(), and Save().

◆ Get_Table()

◆ Ins_Child() [1/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( const CSG_MetaData & MetaData,
int Position,
bool bAddChildren = true )

Definition at line 266 of file metadata.cpp.

References Assign(), CSG_MetaData(), and Ins_Child().

◆ Ins_Child() [2/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( const CSG_String & Name,
const CSG_String & Content,
int Position )

Definition at line 233 of file metadata.cpp.

References CSG_MetaData(), and Ins_Child().

◆ Ins_Child() [3/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( const CSG_String & Name,
double Content,
int Position )

Definition at line 251 of file metadata.cpp.

References CSG_MetaData(), Ins_Child(), and SG_Get_String().

◆ Ins_Child() [4/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( const CSG_String & Name,
int Content,
int Position )

Definition at line 256 of file metadata.cpp.

References CSG_MetaData(), CSG_String::Format(), Ins_Child(), and SG_T.

◆ Ins_Child() [5/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( const CSG_String & Name,
int Position )

Definition at line 246 of file metadata.cpp.

References CSG_MetaData(), and Ins_Child().

◆ Ins_Child() [6/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( const CSG_String & Name,
sLong Content,
int Position )

Definition at line 261 of file metadata.cpp.

References CSG_MetaData(), CSG_String::Format(), Ins_Child(), and SG_T.

◆ Ins_Child() [7/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( int Position)

◆ Load() [1/3]

bool CSG_MetaData::Load ( class wxXmlNode * pNode)

Definition at line 870 of file metadata.cpp.

References Add_Child(), Add_Property(), and Load().

◆ Load() [2/3]

◆ Load() [3/3]

bool CSG_MetaData::Load ( CSG_File & Stream)

Definition at line 853 of file metadata.cpp.

References Destroy(), CSG_File::Get_Stream(), CSG_File::is_Reading(), and Load().

◆ Load_HTTP()

bool CSG_MetaData::Load_HTTP ( const CSG_String & Server,
const CSG_String & Path,
const SG_Char * Username = NULL,
const SG_Char * Password = NULL )

Definition at line 1045 of file metadata.cpp.

References CSG_String::c_str(), Destroy(), Length, Load(), and SG_Char.

Referenced by CSG_HTTP, and Load().

◆ Load_JSON()

bool CSG_MetaData::Load_JSON ( const CSG_String & File)

Definition at line 1104 of file metadata.cpp.

References from_JSON(), JSON, CSG_File::Length(), CSG_File::Open(), CSG_File::Read(), and SG_FILE_R.

Referenced by CSG_HTTP, and Load().

◆ Mov_Child()

bool CSG_MetaData::Mov_Child ( int from_Index,
int to_Index )

Definition at line 284 of file metadata.cpp.

References CSG_MetaData(), and Get_Children_Count().

◆ operator()() [1/2]

CSG_MetaData * CSG_MetaData::operator() ( const CSG_String & Name) const
inline

Definition at line 180 of file metadata.h.

References CSG_MetaData(), and Get_Child().

◆ operator()() [2/2]

CSG_MetaData * CSG_MetaData::operator() ( int Index) const
inline

Definition at line 179 of file metadata.h.

References CSG_MetaData(), and Get_Child().

◆ operator+=()

CSG_MetaData & CSG_MetaData::operator+= ( const CSG_MetaData & MetaData)
inline

Definition at line 134 of file metadata.h.

References Add_Child(), and CSG_MetaData().

◆ operator=()

CSG_MetaData & CSG_MetaData::operator= ( const CSG_MetaData & MetaData)
inline

Definition at line 133 of file metadata.h.

References Assign(), and CSG_MetaData().

◆ operator[]() [1/4]

CSG_MetaData & CSG_MetaData::operator[] ( const CSG_String & Name)
inline

Definition at line 182 of file metadata.h.

References CSG_MetaData(), and Get_Child().

◆ operator[]() [2/4]

const CSG_MetaData & CSG_MetaData::operator[] ( const CSG_String & Name) const
inline

Definition at line 184 of file metadata.h.

References CSG_MetaData(), and Get_Child().

◆ operator[]() [3/4]

CSG_MetaData & CSG_MetaData::operator[] ( int Index)
inline

Definition at line 181 of file metadata.h.

References CSG_MetaData(), and Get_Child().

◆ operator[]() [4/4]

const CSG_MetaData & CSG_MetaData::operator[] ( int Index) const
inline

Definition at line 183 of file metadata.h.

References CSG_MetaData(), and Get_Child().

◆ Save() [1/3]

◆ Save() [2/3]

bool CSG_MetaData::Save ( const CSG_String & File,
const SG_Char * Extension = NULL ) const

◆ Save() [3/3]

bool CSG_MetaData::Save ( CSG_File & Stream) const

Definition at line 924 of file metadata.cpp.

References Get_Name(), CSG_File::Get_Stream(), CSG_File::is_Writing(), and Save().

◆ Save_JSON()

bool CSG_MetaData::Save_JSON ( const CSG_String & File) const

Definition at line 1117 of file metadata.cpp.

References JSON, CSG_File::Open(), SG_FILE_ENCODING_UTF8, SG_FILE_W, to_JSON(), and CSG_File::Write().

Referenced by CSG_HTTP.

◆ Set_Content()

◆ Set_Name()

◆ Set_Property() [1/4]

◆ Set_Property() [2/4]

bool CSG_MetaData::Set_Property ( const CSG_String & Name,
double Value,
bool bAddIfNotExists = true )

Definition at line 662 of file metadata.cpp.

References CSG_String::Format(), Set_Property(), and SG_T.

◆ Set_Property() [3/4]

bool CSG_MetaData::Set_Property ( const CSG_String & Name,
int Value,
bool bAddIfNotExists = true )

Definition at line 667 of file metadata.cpp.

References CSG_String::Format(), Set_Property(), and SG_T.

◆ Set_Property() [4/4]

bool CSG_MetaData::Set_Property ( const CSG_String & Name,
sLong Value,
bool bAddIfNotExists = true )

Definition at line 672 of file metadata.cpp.

References CSG_String::Format(), Set_Property(), and SG_T.

◆ to_JSON()

bool CSG_MetaData::to_JSON ( CSG_String & JSON) const

◆ to_XML()

bool CSG_MetaData::to_XML ( CSG_String & XML) const

Definition at line 1015 of file metadata.cpp.

References CSG_Array::Get_Array(), Get_Name(), CSG_Array::Get_Size(), and Save().

Referenced by CSG_HTTP.

◆ CSG_HTTP

friend class CSG_HTTP
friend

The documentation for this class was generated from the following files: