51#ifndef HEADER_INCLUDED__SAGA_API__metadata_H
52#define HEADER_INCLUDED__SAGA_API__metadata_H
80#include "picojson/picojson.h"
116 bool Load (
class wxXmlNode *pNode);
117 bool Save (
class wxXmlNode *pNode)
const;
121 bool from_XML (
const char *XML,
size_t Length,
const char *Encoding =
"UTF-8");
137 bool Cmp_Name (
const CSG_String &String,
bool bNoCase =
true)
const;
143 bool Get_Content (
const CSG_String &Name,
double &Value)
const;
144 bool Get_Content (
const CSG_String &Name,
int &Value)
const;
147 void Fmt_Content (
const char *Format, ...);
148 void Fmt_Content (
const wchar_t *Format, ...);
149 bool Cmp_Content (
const CSG_String &String,
bool bNoCase =
false)
const;
153 int Get_Count (
void)
const {
return( (
int)m_Children.Get_Size() ); }
172 bool Mov_Child (
int from_Index,
int to_Index);
173 bool Del_Child (
int Index);
177 bool Del_Children (
int Depth = 0,
const SG_Char *Name = NULL);
188 const SG_Char *
Get_Property (
int Index)
const {
return( Index >= 0 && Index < m_Prop_Values.Get_Count() ? m_Prop_Values[Index].c_str() : NULL ); }
191 bool Get_Property (
const CSG_String &Name,
double &Value)
const;
192 bool Get_Property (
const CSG_String &Name,
int &Value)
const;
195 bool Add_Property (
const CSG_String &Name,
double Value);
196 bool Add_Property (
const CSG_String &Name,
int Value);
198 bool Set_Property (
const CSG_String &Name,
const CSG_String &Value,
bool bAddIfNotExists =
true);
199 bool Set_Property (
const CSG_String &Name,
double Value,
bool bAddIfNotExists =
true);
200 bool Set_Property (
const CSG_String &Name,
int Value,
bool bAddIfNotExists =
true);
201 bool Set_Property (
const CSG_String &Name,
sLong Value,
bool bAddIfNotExists =
true);
202 bool Cmp_Property (
const CSG_String &Name,
const CSG_String &String,
bool bNoCase =
false)
const;
204 bool Del_Property (
int i);
207 class CSG_Table Get_Table (int Flags = 0)
const;
224 void _On_Construction (
void);
226 int _Get_Child (
const CSG_String &Name)
const;
227 int _Get_Property (
const CSG_String &Name)
const;
229 void _JSON_To_MetaData (
const picojson::value &j,
CSG_MetaData *pNode);
264 class wxHTTP *m_pHTTP = NULL;
267 class wxInputStream * _Request (
const CSG_String &Request);
#define SAGA_API_DLL_EXPORT
bool is_Connected(void) const
bool Post(const CSG_String &Request, const CSG_String &Body, CSG_Bytes &Answer, const CSG_String &ContentType="application/json")
bool Request(const CSG_String &Request, CSG_Bytes &Answer)