Files correlati : servers Ricompilazione Demo : [ ] Commento : Gestione database tramite ODBC git-svn-id: svn://10.65.10.50/trunk@11402 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			70 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#ifndef __XML_H
 | 
						|
#define __XML_H
 | 
						|
 | 
						|
class TXmlItem;
 | 
						|
 | 
						|
typedef bool (*XmlItemCallback)(TXmlItem& item, long jolly);
 | 
						|
 | 
						|
class TXmlItem : public wxObject
 | 
						|
{
 | 
						|
  DECLARE_DYNAMIC_CLASS(TXmlItem);
 | 
						|
 | 
						|
	wxString m_strTag, m_strText;
 | 
						|
	wxHashTable* m_Attributes;
 | 
						|
  wxList* m_Children;
 | 
						|
 | 
						|
protected:
 | 
						|
  wxString GetWord(wxInputStream& input) const;
 | 
						|
  int ReadTag(wxInputStream& input);
 | 
						|
 | 
						|
  TXmlItem& AddChild(TXmlItem* pItem);
 | 
						|
 | 
						|
public:
 | 
						|
  const wxString& GetTag() const { return m_strTag; }
 | 
						|
  void SetTag(const wxChar* strTag) { m_strTag = strTag; }
 | 
						|
 | 
						|
  const wxString& GetText() const { return m_strText; }
 | 
						|
  void SetText(const wxChar* str) { m_strText = str; }
 | 
						|
 | 
						|
	TXmlItem& AddEnclosedText(const wxChar* str);
 | 
						|
  wxString GetEnclosedText() const;
 | 
						|
 | 
						|
  TXmlItem& SetAttr(const wxChar* strAttr, const wxChar* strVal);
 | 
						|
	wxString GetAttr(const wxChar* strAttr) const;
 | 
						|
  TXmlItem& SetAttr(const wxChar* strAttr, long nVal);
 | 
						|
 | 
						|
  TXmlItem& AddChild(const wxChar* strTag);
 | 
						|
	TXmlItem& AddSoapString(const wxChar* name, const wxChar* value, bool typized = false);
 | 
						|
	TXmlItem& AddSoapInt(const wxChar* name, int value, bool typized = false);
 | 
						|
 | 
						|
  int GetChildren() const;
 | 
						|
  TXmlItem* GetChild(size_t n) const;
 | 
						|
  void RemoveLastChild();
 | 
						|
 | 
						|
	bool Read(wxInputStream& input);
 | 
						|
	void Write(wxOutputStream& output, int nTab) const;
 | 
						|
  wxString AsString() const;
 | 
						|
 | 
						|
	void Save(const wxChar* strFilename) const;
 | 
						|
 | 
						|
	TXmlItem* ForEach(XmlItemCallback cb, long jolly = 0);
 | 
						|
  TXmlItem* FindFirst(const wxChar* strTag) const;
 | 
						|
	
 | 
						|
	TXmlItem();
 | 
						|
	~TXmlItem();
 | 
						|
};
 | 
						|
 | 
						|
TXmlItem& operator<<(TXmlItem& item, const wxChar* str);
 | 
						|
 | 
						|
wxOutputStream& operator<<(wxOutputStream& outf, const wxChar* str);
 | 
						|
wxOutputStream& operator<<(wxOutputStream& outf, wxString str);
 | 
						|
wxInputStream& operator>>(wxInputStream& inf, wxString& str);
 | 
						|
void Spaces(wxOutputStream& outf, int nSpaces);
 | 
						|
void WriteXmlString(wxOutputStream& outf, const wxChar* str);
 | 
						|
int hex2int(const wxChar* str);
 | 
						|
 | 
						|
#define endl "\r\n";
 | 
						|
 | 
						|
#endif
 | 
						|
 |