home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _ECE3BF4F150E495A8E211C6D8F92EA17 < prev    next >
Encoding:
Text File  |  2003-05-21  |  22.8 KB  |  917 lines

  1. ////////////////////////////////////////////////////////////////////////
  2. //
  3. // SchemaTypes.h
  4. //
  5. // This file was generated by XMLSPY 5 Enterprise Edition.
  6. //
  7. // YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
  8. // OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
  9. //
  10. // Refer to the XMLSPY Documentation for further details.
  11. // http://www.altova.com/xmlspy
  12. //
  13. ////////////////////////////////////////////////////////////////////////
  14.  
  15.  
  16. #ifndef ALTOVA_SCHEMATYPES_H_INCLUDED
  17. #define ALTOVA_SCHEMATYPES_H_INCLUDED
  18.  
  19. #if _MSC_VER > 1000
  20.     #pragma once
  21. #endif // _MSC_VER > 1000
  22.  
  23. namespace altova {
  24.  
  25.  
  26. #ifndef _USRDLL
  27.     #define ALTOVA_DECLSPECIFIER
  28. #else
  29.     #ifdef ALTOVA_EXPORTS
  30.         #define ALTOVA_DECLSPECIFIER __declspec(dllexport)
  31.         #define ALTOVA_EXPIMP_TEMPLATE
  32.     #else
  33.         #define ALTOVA_DECLSPECIFIER __declspec(dllimport)
  34.         #define ALTOVA_EXPIMP_TEMPLATE extern
  35.     #endif
  36.  
  37.     #ifndef _MFC_VER
  38.         #pragma warning(disable: 4660)
  39.         #pragma warning(disable: 4231)
  40.         #pragma warning(disable: 4251)
  41.         ALTOVA_EXPIMP_TEMPLATE template class ALTOVA_DECLSPECIFIER std::basic_string<char>;
  42.         ALTOVA_EXPIMP_TEMPLATE template class ALTOVA_DECLSPECIFIER std::basic_istream<char>;
  43.         ALTOVA_EXPIMP_TEMPLATE template class ALTOVA_DECLSPECIFIER std::basic_ostream<char>;
  44.         ALTOVA_EXPIMP_TEMPLATE template class ALTOVA_DECLSPECIFIER std::basic_string<wchar_t>;
  45.         ALTOVA_EXPIMP_TEMPLATE template class ALTOVA_DECLSPECIFIER std::basic_istream<wchar_t>;
  46.         ALTOVA_EXPIMP_TEMPLATE template class ALTOVA_DECLSPECIFIER std::basic_ostream<wchar_t>;
  47.     #endif
  48. #endif
  49.  
  50.  
  51. #if defined(UNICODE) || defined(_UNICODE)
  52.     #define tstring        std::wstring
  53.     #define tcin        std::wcin
  54.     #define tcout        std::wcout
  55.     #define tcerr        std::wcerr
  56.     #define tclog        std::wclog
  57.     #define tostream    std::wostream
  58. #else
  59.     #define tstring        std::string
  60.     #define tcin        std::cin
  61.     #define tcout        std::cout
  62.     #define tcerr        std::cerr
  63.     #define tclog        std::clog
  64.     #define tostream    std::ostream
  65. #endif
  66.  
  67.  
  68. #ifdef _XERCES_VERSION
  69.  
  70.     #if defined(UNICODE) || defined(_UNICODE)
  71.         #define XC2TS(x) x
  72.     #else
  73.         #define XC2TS(x) StrX(x).localForm()
  74.     #endif
  75.  
  76.     class XStr
  77.     {
  78.     public:
  79.         XStr(const char* const toTranscode) { m_bClone = true; fUnicodeForm = xercesc::XMLString::transcode(toTranscode); }
  80.         XStr(const std::string& toTranscode) { m_bClone = true; fUnicodeForm = xercesc::XMLString::transcode(toTranscode.c_str()); }
  81.         XStr(const wchar_t* const toTranscode) { m_bClone = false; fUnicodeForm = (XMLCh*)toTranscode; }
  82.         XStr(const std::wstring& toTranscode) { m_bClone = false; fUnicodeForm = (XMLCh*)(toTranscode.c_str()); }
  83.         ~XStr() { if (m_bClone && fUnicodeForm) xercesc::XMLString::release(&fUnicodeForm); }
  84.         const XMLCh* unicodeForm() const { return fUnicodeForm; }
  85.     protected:
  86.         bool m_bClone;
  87.         XMLCh* fUnicodeForm;
  88.     };
  89.  
  90.     #define X(str) XStr(str).unicodeForm()
  91.  
  92.     class StrX
  93.     {
  94.     public:
  95.         StrX(const XMLCh* const toTranscode) { fLocalForm = xercesc::XMLString::transcode(toTranscode); }
  96.         ~StrX() { xercesc::XMLString::release(&fLocalForm); }
  97.         const char* localForm() const { return fLocalForm; }
  98.     protected:
  99.         char* fLocalForm;
  100.     };
  101.  
  102. #endif
  103. #ifdef _MFC_VER
  104.     inline tostream& operator<<(tostream& out, const CString& sText)
  105.     {
  106.         return tcout << (LPCTSTR)sText;
  107.     }
  108. #endif // _MFC_VER
  109.  
  110.  
  111. ////////////////////////////////////////////////////////////////////////
  112. //
  113. //  CSchemaType
  114. //
  115. ////////////////////////////////////////////////////////////////////////
  116.  
  117.  
  118. class ALTOVA_DECLSPECIFIER CSchemaType
  119. {
  120. public:
  121.     virtual operator tstring() const = 0;
  122. [if $mfc]
  123.     virtual operator CString() { return operator tstring().c_str(); }
  124. [endif]
  125.  
  126.     enum {
  127.         WHITESPACE_PRESERVE,
  128.         WHITESPACE_REPLACE,
  129.         WHITESPACE_COLLAPSE
  130.     };
  131. };
  132.  
  133.  
  134. inline tostream& operator<<(tostream& os, CSchemaType& t)
  135. {
  136.     return os << ((tstring)t).c_str();
  137. }
  138.  
  139.  
  140. ////////////////////////////////////////////////////////////////////////
  141. //
  142. //  CSchemaBoolean
  143. //
  144. ////////////////////////////////////////////////////////////////////////
  145.  
  146.  
  147. class ALTOVA_DECLSPECIFIER CSchemaBoolean : public CSchemaType
  148. {
  149. public:
  150.     CSchemaBoolean(bool fValue);
  151.     CSchemaBoolean(const TCHAR* szValue);
  152.     virtual operator bool() const;
  153.     virtual operator tstring() const;
  154.  
  155.     typedef bool basetype;
  156.  
  157. protected:
  158.     bool m_Value;
  159. };
  160.  
  161.  
  162. ////////////////////////////////////////////////////////////////////////
  163. //
  164. //  CSchemaFloat (32bit floating point number)
  165. //
  166. ////////////////////////////////////////////////////////////////////////
  167.  
  168.  
  169. class ALTOVA_DECLSPECIFIER CSchemaFloat : public CSchemaType
  170. {
  171. public:
  172.     CSchemaFloat(float fValue);
  173.     CSchemaFloat(const TCHAR* szValue);
  174.     virtual operator float() const;
  175.     virtual operator tstring() const;
  176.  
  177.     typedef float basetype;
  178.  
  179. protected:
  180.     float m_Value;
  181. };
  182.  
  183.  
  184. ////////////////////////////////////////////////////////////////////////
  185. //
  186. //  CSchemaDouble (64bit floating point number)
  187. //
  188. ////////////////////////////////////////////////////////////////////////
  189.  
  190.  
  191. class ALTOVA_DECLSPECIFIER CSchemaDouble : public CSchemaType
  192. {
  193. public:
  194.     CSchemaDouble(double fValue);
  195.     CSchemaDouble(const TCHAR* szValue);
  196.     virtual operator double() const;
  197.     virtual operator tstring() const;
  198.  
  199.     typedef double basetype;
  200.  
  201. protected:
  202.     double m_Value;
  203. };
  204.  
  205.  
  206. ////////////////////////////////////////////////////////////////////////
  207. //
  208. //  CSchemaDecimal
  209. //
  210. ////////////////////////////////////////////////////////////////////////
  211.  
  212.  
  213. class ALTOVA_DECLSPECIFIER CSchemaDecimal : public CSchemaType
  214. {
  215. public:
  216.     CSchemaDecimal(double fValue);
  217.     CSchemaDecimal(const TCHAR* szValue);
  218.     virtual operator double() const;
  219.     virtual operator tstring() const;
  220.  
  221.     typedef double basetype;
  222.  
  223. protected:
  224.     double m_Value;
  225. };
  226.  
  227.  
  228. ////////////////////////////////////////////////////////////////////////
  229. //
  230. //  CSchemaLong (signed 64bit integer)
  231. //
  232. ////////////////////////////////////////////////////////////////////////
  233.  
  234.  
  235. class ALTOVA_DECLSPECIFIER CSchemaLong : public CSchemaType
  236. {
  237. public:
  238.     CSchemaLong(__int64 nValue);
  239.     CSchemaLong(const TCHAR* szValue);
  240.     virtual operator __int64() const;
  241.     virtual operator tstring() const;
  242.  
  243.     typedef __int64 basetype;
  244.  
  245. protected:
  246.     __int64 m_Value;
  247. };
  248.  
  249.  
  250. ////////////////////////////////////////////////////////////////////////
  251. //
  252. //  CSchemaUnsignedLong (unsigned 64bit integer)
  253. //
  254. ////////////////////////////////////////////////////////////////////////
  255.  
  256.  
  257. class ALTOVA_DECLSPECIFIER CSchemaUnsignedLong : public CSchemaType
  258. {
  259. public:
  260.     CSchemaUnsignedLong(unsigned __int64 nValue);
  261.     CSchemaUnsignedLong(const TCHAR* szValue);
  262.     virtual operator unsigned __int64() const;
  263.     virtual operator tstring() const;
  264.  
  265.     typedef unsigned __int64 basetype;
  266.  
  267. protected:
  268.     unsigned __int64 m_Value;
  269. };
  270.  
  271.  
  272. ////////////////////////////////////////////////////////////////////////
  273. //
  274. //  CSchemaInt (signed 32bit integer)
  275. //
  276. ////////////////////////////////////////////////////////////////////////
  277.  
  278.  
  279. class ALTOVA_DECLSPECIFIER CSchemaInt : public CSchemaType
  280. {
  281. public:
  282.     CSchemaInt(long nValue);
  283.     CSchemaInt(const TCHAR* szValue);
  284.     virtual operator long() const;
  285.     virtual operator tstring() const;
  286.  
  287.     typedef long basetype;
  288.  
  289. protected:
  290.     long m_Value;
  291. };
  292.  
  293.  
  294. ////////////////////////////////////////////////////////////////////////
  295. //
  296. //  CSchemaUnsignedInt (unsigned 32bit integer)
  297. //
  298. ////////////////////////////////////////////////////////////////////////
  299.  
  300.  
  301. class ALTOVA_DECLSPECIFIER CSchemaUnsignedInt : public CSchemaType
  302. {
  303. public:
  304.     CSchemaUnsignedInt(unsigned long nValue);
  305.     CSchemaUnsignedInt(const TCHAR* szValue);
  306.     virtual operator unsigned long() const;
  307.     virtual operator tstring() const;
  308.  
  309.     typedef unsigned long basetype;
  310.  
  311. protected:
  312.     unsigned long m_Value;
  313. };
  314.  
  315.  
  316. ////////////////////////////////////////////////////////////////////////
  317. //
  318. //  CSchemaShort (signed 16bit integer)
  319. //
  320. ////////////////////////////////////////////////////////////////////////
  321.  
  322.  
  323. class ALTOVA_DECLSPECIFIER CSchemaShort : public CSchemaType
  324. {
  325. public:
  326.     CSchemaShort(short nValue);
  327.     CSchemaShort(const TCHAR* szValue);
  328.     virtual operator short() const;
  329.     virtual operator tstring() const;
  330.  
  331.     typedef short basetype;
  332.  
  333. protected:
  334.     short m_Value;
  335. };
  336.  
  337.  
  338. ////////////////////////////////////////////////////////////////////////
  339. //
  340. //  CSchemaUnsignedShort (unsigned 16bit integer)
  341. //
  342. ////////////////////////////////////////////////////////////////////////
  343.  
  344.  
  345. class ALTOVA_DECLSPECIFIER CSchemaUnsignedShort : public CSchemaType
  346. {
  347. public:
  348.     CSchemaUnsignedShort(unsigned short nValue);
  349.     CSchemaUnsignedShort(const TCHAR* szValue);
  350.     virtual operator unsigned short() const;
  351.     virtual operator tstring() const;
  352.  
  353.     typedef unsigned short basetype;
  354.  
  355. protected:
  356.     unsigned short m_Value;
  357. };
  358.  
  359.  
  360. ////////////////////////////////////////////////////////////////////////
  361. //
  362. //  CSchemaByte (signed 8bit integer)
  363. //
  364. ////////////////////////////////////////////////////////////////////////
  365.  
  366.  
  367. class ALTOVA_DECLSPECIFIER CSchemaByte : public CSchemaType
  368. {
  369. public:
  370.     CSchemaByte(char nValue);
  371.     CSchemaByte(const TCHAR* szValue);
  372.     virtual operator char() const;
  373.     virtual operator tstring() const;
  374.  
  375.     typedef char basetype;
  376.  
  377. protected:
  378.     char m_Value;
  379. };
  380.  
  381.  
  382. ////////////////////////////////////////////////////////////////////////
  383. //
  384. //  CSchemaUnsignedByte (unsigned 8bit integer)
  385. //
  386. ////////////////////////////////////////////////////////////////////////
  387.  
  388.  
  389. class ALTOVA_DECLSPECIFIER CSchemaUnsignedByte : public CSchemaType
  390. {
  391. public:
  392.     CSchemaUnsignedByte(unsigned char nValue);
  393.     CSchemaUnsignedByte(const TCHAR* szValue);
  394.     virtual operator unsigned char() const;
  395.     virtual operator tstring() const;
  396.  
  397.     typedef unsigned char basetype;
  398.  
  399. protected:
  400.     unsigned char m_Value;
  401. };
  402.  
  403.  
  404. ////////////////////////////////////////////////////////////////////////
  405. //
  406. //  CSchemaInteger
  407. //  CSchemaNegativeInteger
  408. //  CSchemaNonNegativeInteger
  409. //  CSchemaPositiveInteger
  410. //  CSchemaNonPositiveInteger
  411. //
  412. ////////////////////////////////////////////////////////////////////////
  413.  
  414.  
  415. typedef CSchemaLong        CSchemaInteger;
  416. typedef CSchemaInteger    CSchemaNegativeInteger;
  417. typedef CSchemaInteger    CSchemaNonNegativeInteger;
  418. typedef CSchemaInteger    CSchemaPositiveInteger;
  419. typedef CSchemaInteger    CSchemaNonPositiveInteger;
  420.  
  421.  
  422. ////////////////////////////////////////////////////////////////////////
  423. //
  424. //  CSchemaString family
  425. //
  426. ////////////////////////////////////////////////////////////////////////
  427.  
  428.  
  429. class ALTOVA_DECLSPECIFIER CSchemaString : public CSchemaType
  430. {
  431. public:
  432.     CSchemaString(tstring sValue);
  433.     CSchemaString(const TCHAR* szValue);
  434.     virtual operator tstring() const;
  435.  
  436.     typedef const TCHAR* basetype;
  437.  
  438. protected:
  439.     tstring m_Value;
  440. };
  441.  
  442.  
  443. typedef CSchemaString CSchemaNormalizedString;
  444. typedef CSchemaString CSchemaToken;
  445. typedef CSchemaString CSchemaLanguage;
  446. typedef CSchemaString CSchemaName;
  447. typedef CSchemaString CSchemaNMToken;
  448. typedef CSchemaString CSchemaNMTokens;
  449. typedef CSchemaString CSchemaNCName;
  450. typedef CSchemaString CSchemaID;
  451. typedef CSchemaString CSchemaIDRef;
  452. typedef CSchemaString CSchemaIDRefs;
  453. typedef CSchemaString CSchemaEntity;
  454. typedef CSchemaString CSchemaEntities;
  455. typedef CSchemaString CSchemaAnyURI;
  456. typedef CSchemaString CSchemaQName;
  457. typedef CSchemaString CSchemaNotation;
  458.  
  459.  
  460. ////////////////////////////////////////////////////////////////////////
  461. //
  462. //  CSchemaDuration
  463. //
  464. ////////////////////////////////////////////////////////////////////////
  465.  
  466.  
  467. class ALTOVA_DECLSPECIFIER CSchemaDuration : public CSchemaType
  468. {
  469. public:
  470.     CSchemaDuration(bool bPositive, int nYear, int nMonth, int nDay, int nHour, int nMinute, double dSecond);
  471.     CSchemaDuration(const TCHAR* szValue);
  472.     virtual operator tstring() const;
  473.  
  474.     bool IsPositive() const;
  475.     int GetYear() const;
  476.     int GetMonth() const;
  477.     int GetDay() const;
  478.     int GetHour() const;
  479.     int GetMinute() const;
  480.     double GetSecond() const;
  481.  
  482.     void SetPositive(bool bPositive);
  483.     void SetYear(int nYear);
  484.     void SetMonth(int nMonth);
  485.     void SetDay(int nDay);
  486.     void SetHour(int nHour);
  487.     void SetMinute(int nMinute);
  488.     void SetSecond(double dSecond);
  489.  
  490.     friend CSchemaDuration operator+(const CSchemaDuration& dur1, const CSchemaDuration& dur2);
  491.  
  492.     typedef const TCHAR* basetype;
  493.  
  494. protected:
  495.     void Parse(const TCHAR* szValue);
  496.  
  497.     bool    m_bPositive;
  498.     int        m_nYear;
  499.     int        m_nMonth;
  500.     int        m_nDay;
  501.     int        m_nHour;
  502.     int        m_nMinute;
  503.     double    m_dSecond;
  504. };
  505.  
  506.  
  507. ////////////////////////////////////////////////////////////////////////
  508. //
  509. //  CSchemaDateTimeBase
  510. //
  511. ////////////////////////////////////////////////////////////////////////
  512.  
  513.  
  514. class ALTOVA_DECLSPECIFIER CSchemaDateTimeBase : public CSchemaType
  515. {
  516. public:
  517.     CSchemaDateTimeBase();
  518.     CSchemaDateTimeBase(bool bUTC);
  519.     CSchemaDateTimeBase(int nOffset);
  520.  
  521.     bool HasTimezone() const;
  522.     int GetTimezoneMode() const;
  523.     int GetOffset() const;
  524.  
  525.     void SetTimezoneMode(int nTZMode);
  526.     void SetOffset(int nOffset);
  527.  
  528.     enum
  529.     {
  530.         TZ_UTC,
  531.         TZ_Offset,
  532.         TZ_Missing
  533.     };
  534.  
  535. protected:
  536.     static int WriteTime(TCHAR* szTarget, int nHour, int nMinute, double dSecond);
  537.  
  538.     void ParseTZ(const TCHAR* szValue);
  539.     void WriteTZ(TCHAR* szTarget) const;
  540.  
  541.     int        m_nTZMode;
  542.     int        m_nOffset;
  543. };
  544.  
  545.  
  546. ////////////////////////////////////////////////////////////////////////
  547. //
  548. //  CSchemaDate
  549. //
  550. ////////////////////////////////////////////////////////////////////////
  551.  
  552.  
  553. class ALTOVA_DECLSPECIFIER CSchemaDate : public CSchemaDateTimeBase
  554. {
  555. public:
  556.     CSchemaDate(int nYear, int nMonth, int nDay, bool bUTC = false);
  557.     CSchemaDate(int nYear, int nMonth, int nDay, int nOffset);
  558.     CSchemaDate(const TCHAR* szValue);
  559.     virtual operator tstring() const;
  560.  
  561.     int GetYear() const;
  562.     int GetMonth() const;
  563.     int GetDay() const;
  564.  
  565.     void SetYear(int nYear);
  566.     void SetMonth(int nMonth);
  567.     void SetDay(int nDay);
  568.  
  569.     friend bool operator==(const CSchemaDate& t1, const CSchemaDate& t2);
  570.     friend bool operator< (const CSchemaDate& t1, const CSchemaDate& t2);
  571.     friend bool operator!=(const CSchemaDate& t1, const CSchemaDate& t2);
  572.     friend bool operator<=(const CSchemaDate& t1, const CSchemaDate& t2);
  573.     friend bool operator> (const CSchemaDate& t1, const CSchemaDate& t2);
  574.     friend bool operator>=(const CSchemaDate& t1, const CSchemaDate& t2);
  575.  
  576.     friend CSchemaDate operator+(const CSchemaDate& t, const CSchemaDuration& dur);
  577.     friend CSchemaDuration operator-(const CSchemaDate& t1, const CSchemaDate& t2);
  578.  
  579.     typedef const TCHAR* basetype;
  580.  
  581. protected:
  582.     void Parse(const TCHAR* szValue);
  583.  
  584.     int        m_nYear;
  585.     int        m_nMonth;
  586.     int        m_nDay;
  587. };
  588.  
  589.  
  590. ////////////////////////////////////////////////////////////////////////
  591. //
  592. //  CSchemaTime
  593. //
  594. ////////////////////////////////////////////////////////////////////////
  595.  
  596.  
  597. class ALTOVA_DECLSPECIFIER CSchemaTime : public CSchemaDateTimeBase
  598. {
  599. public:
  600.     CSchemaTime(int nHour, int nMinute, double dSecond, bool bUTC = false);
  601.     CSchemaTime(int nHour, int nMinute, double dSecond, int nOffset);
  602.     CSchemaTime(const TCHAR* szValue);
  603.     virtual operator tstring() const;
  604.  
  605.     int GetHour() const;
  606.     int GetMinute() const;
  607.     double GetSecond() const;
  608.  
  609.     void SetHour(int nHour);
  610.     void SetMinute(int nMinute);
  611.     void SetSecond(double dSecond);
  612.  
  613.     friend bool operator==(const CSchemaTime& t1, const CSchemaTime& t2);
  614.     friend bool operator< (const CSchemaTime& t1, const CSchemaTime& t2);
  615.     friend bool operator!=(const CSchemaTime& t1, const CSchemaTime& t2);
  616.     friend bool operator<=(const CSchemaTime& t1, const CSchemaTime& t2);
  617.     friend bool operator> (const CSchemaTime& t1, const CSchemaTime& t2);
  618.     friend bool operator>=(const CSchemaTime& t1, const CSchemaTime& t2);
  619.  
  620.     friend CSchemaTime operator+(const CSchemaTime& t, const CSchemaDuration& dur);
  621.     friend CSchemaDuration operator-(const CSchemaTime& t1, const CSchemaTime& t2);
  622.  
  623.     typedef const TCHAR* basetype;
  624.  
  625. protected:
  626.     void Parse(const TCHAR* szValue);
  627.     double NormalizedSeconds() const;
  628.  
  629.     int        m_nHour;
  630.     int        m_nMinute;
  631.     double    m_dSecond;
  632. };
  633.  
  634.  
  635. ////////////////////////////////////////////////////////////////////////
  636. //
  637. //  CSchemaDateTime
  638. //
  639. ////////////////////////////////////////////////////////////////////////
  640.  
  641.  
  642. class ALTOVA_DECLSPECIFIER CSchemaDateTime : public CSchemaDateTimeBase
  643. {
  644. public:
  645.     CSchemaDateTime(int nYear, int nMonth, int nDay, int nHour, int nMinute, double dSecond, bool bUTC = false);
  646.     CSchemaDateTime(int nYear, int nMonth, int nDay, int nHour, int nMinute, double dSecond, int nOffset);
  647.     CSchemaDateTime(const TCHAR* szValue);
  648.     virtual operator tstring() const;
  649.  
  650.     int GetYear() const;
  651.     int GetMonth() const;
  652.     int GetDay() const;
  653.     int GetHour() const;
  654.     int GetMinute() const;
  655.     double GetSecond() const;
  656.  
  657.     void SetYear(int nYear);
  658.     void SetMonth(int nMonth);
  659.     void SetDay(int nDay);
  660.     void SetHour(int nHour);
  661.     void SetMinute(int nMinute);
  662.     void SetSecond(double dSecond);
  663.  
  664.     friend bool operator==(const CSchemaDateTime& t1, const CSchemaDateTime& t2);
  665.     friend bool operator< (const CSchemaDateTime& t1, const CSchemaDateTime& t2);
  666.     friend bool operator!=(const CSchemaDateTime& t1, const CSchemaDateTime& t2);
  667.     friend bool operator<=(const CSchemaDateTime& t1, const CSchemaDateTime& t2);
  668.     friend bool operator> (const CSchemaDateTime& t1, const CSchemaDateTime& t2);
  669.     friend bool operator>=(const CSchemaDateTime& t1, const CSchemaDateTime& t2);
  670.  
  671.     friend CSchemaDateTime operator+(const CSchemaDateTime& t, const CSchemaDuration& dur);
  672.     friend CSchemaDuration operator-(const CSchemaDateTime& t1, const CSchemaDateTime& t2);
  673.  
  674.     typedef const TCHAR* basetype;
  675.  
  676. protected:
  677.     void Parse(const TCHAR* szValue);
  678.  
  679.     int        m_nYear;
  680.     int        m_nMonth;
  681.     int        m_nDay;
  682.  
  683.     int        m_nHour;
  684.     int        m_nMinute;
  685.     double    m_dSecond;
  686. };
  687.  
  688.  
  689. ////////////////////////////////////////////////////////////////////////
  690. //
  691. //  CSchemaYear
  692. //
  693. ////////////////////////////////////////////////////////////////////////
  694.  
  695.  
  696. class ALTOVA_DECLSPECIFIER CSchemaYear : public CSchemaDateTimeBase
  697. {
  698. public:
  699.     CSchemaYear(int nYear, bool bUTC = false);
  700.     CSchemaYear(int nYear, int nOffset);
  701.     CSchemaYear(const TCHAR* szValue);
  702.     virtual operator tstring() const;
  703.  
  704.     int GetYear() const;
  705.  
  706.     void SetYear(int nYear);
  707.  
  708.     typedef const TCHAR* basetype;
  709.  
  710. protected:
  711.     void Parse(const TCHAR* szValue);
  712.  
  713.     int        m_nYear;
  714. };
  715.  
  716.  
  717. ////////////////////////////////////////////////////////////////////////
  718. //
  719. //  CSchemaYearMonth
  720. //
  721. ////////////////////////////////////////////////////////////////////////
  722.  
  723.  
  724. class ALTOVA_DECLSPECIFIER CSchemaYearMonth : public CSchemaDateTimeBase
  725. {
  726. public:
  727.     CSchemaYearMonth(int nYear, int nMonth, bool bUTC = false);
  728.     CSchemaYearMonth(int nYear, int nMonth, int nOffset);
  729.     CSchemaYearMonth(const TCHAR* szValue);
  730.     virtual operator tstring() const;
  731.  
  732.     int GetYear() const;
  733.     int GetMonth() const;
  734.  
  735.     void SetYear(int nYear);
  736.     void SetMonth(int nMonth);
  737.  
  738.     typedef const TCHAR* basetype;
  739.  
  740. protected:
  741.     void Parse(const TCHAR* szValue);
  742.  
  743.     int        m_nYear;
  744.     int        m_nMonth;
  745. };
  746.  
  747.  
  748. ////////////////////////////////////////////////////////////////////////
  749. //
  750. //  CSchemaMonth
  751. //
  752. ////////////////////////////////////////////////////////////////////////
  753.  
  754.  
  755. class ALTOVA_DECLSPECIFIER CSchemaMonth : public CSchemaDateTimeBase
  756. {
  757. public:
  758.     CSchemaMonth(int nMonth, bool bUTC = false);
  759.     CSchemaMonth(int nMonth, int nOffset);
  760.     CSchemaMonth(const TCHAR* szValue);
  761.     virtual operator tstring() const;
  762.  
  763.     int GetMonth() const;
  764.  
  765.     void SetMonth(int nMonth);
  766.  
  767.     typedef const TCHAR* basetype;
  768.  
  769. protected:
  770.     void Parse(const TCHAR* szValue);
  771.  
  772.     int        m_nMonth;
  773. };
  774.  
  775.  
  776. ////////////////////////////////////////////////////////////////////////
  777. //
  778. //  CSchemaMonthDay
  779. //
  780. ////////////////////////////////////////////////////////////////////////
  781.  
  782.  
  783. class ALTOVA_DECLSPECIFIER CSchemaMonthDay : public CSchemaDateTimeBase
  784. {
  785. public:
  786.     CSchemaMonthDay(int nMonth, int nDay, bool bUTC = false);
  787.     CSchemaMonthDay(int nMonth, int nDay, int nOffset);
  788.     CSchemaMonthDay(const TCHAR* szValue);
  789.     virtual operator tstring() const;
  790.  
  791.     int GetMonth() const;
  792.     int GetDay() const;
  793.  
  794.     void SetMonth(int nMonth);
  795.     void SetDay(int nYear);
  796.  
  797.     typedef const TCHAR* basetype;
  798.  
  799. protected:
  800.     void Parse(const TCHAR* szValue);
  801.  
  802.     int        m_nMonth;
  803.     int        m_nDay;
  804. };
  805.  
  806.  
  807. ////////////////////////////////////////////////////////////////////////
  808. //
  809. //  CSchemaDay
  810. //
  811. ////////////////////////////////////////////////////////////////////////
  812.  
  813.  
  814. class ALTOVA_DECLSPECIFIER CSchemaDay : public CSchemaDateTimeBase
  815. {
  816. public:
  817.     CSchemaDay(int nDay, bool bUTC = false);
  818.     CSchemaDay(int nDay, int nOffset);
  819.     CSchemaDay(const TCHAR* szValue);
  820.     virtual operator tstring() const;
  821.  
  822.     int GetDay() const;
  823.  
  824.     void SetDay(int nYear);
  825.  
  826.     typedef const TCHAR* basetype;
  827.  
  828. protected:
  829.     void Parse(const TCHAR* szValue);
  830.  
  831.     int        m_nDay;
  832. };
  833.  
  834.  
  835. ////////////////////////////////////////////////////////////////////////
  836. //
  837. //  CSchemaHexBinary
  838. //
  839. ////////////////////////////////////////////////////////////////////////
  840.  
  841.  
  842. class ALTOVA_DECLSPECIFIER CSchemaHexBinary : public CSchemaType
  843. {
  844. public:
  845.     CSchemaHexBinary(const CSchemaHexBinary& rOther);
  846.     CSchemaHexBinary(const unsigned char* pData, int nSize);
  847.     CSchemaHexBinary(const TCHAR* szValue);
  848.     virtual ~CSchemaHexBinary();
  849.     virtual CSchemaHexBinary& operator=(const CSchemaHexBinary& rOther);
  850.     virtual operator tstring() const;
  851.  
  852.     int GetSize() const;
  853.     const unsigned char* GetData() const;
  854.     unsigned char* GetData();
  855.  
  856.     void SetData(const unsigned char* pData, int nSize);
  857.  
  858.     typedef const TCHAR* basetype;
  859.  
  860. protected:
  861.     void Clone(const CSchemaHexBinary& rOther);
  862.     void Clone(const unsigned char* pData, int nSize);
  863.     void Parse(const TCHAR* szValue);
  864.  
  865.     static const TCHAR sm_EncodeArray\[\];
  866.     static const TCHAR sm_DecodeArray\[\];
  867.  
  868.  
  869.     int                m_nSize;
  870.     unsigned char*    m_pData;
  871. };
  872.  
  873.  
  874. ////////////////////////////////////////////////////////////////////////
  875. //
  876. //  CSchemaBase64Binary
  877. //
  878. ////////////////////////////////////////////////////////////////////////
  879.  
  880.  
  881. class ALTOVA_DECLSPECIFIER CSchemaBase64Binary : public CSchemaType
  882. {
  883. public:
  884.     CSchemaBase64Binary(const CSchemaBase64Binary& rOther);
  885.     CSchemaBase64Binary(const unsigned char* pData, int nSize);
  886.     CSchemaBase64Binary(const TCHAR* szValue);
  887.     virtual ~CSchemaBase64Binary();
  888.     virtual CSchemaBase64Binary& operator=(const CSchemaBase64Binary& rOther);
  889.     virtual operator tstring() const;
  890.  
  891.     int GetSize() const;
  892.     const unsigned char* GetData() const;
  893.     unsigned char* GetData();
  894.  
  895.     void SetData(const unsigned char* pData, int nSize);
  896.  
  897.     typedef const TCHAR* basetype;
  898.  
  899. protected:
  900.     void Clone(const CSchemaBase64Binary& rOther);
  901.     void Clone(const unsigned char* pData, int nSize);
  902.  
  903.     void Encode(unsigned char* pSrc, int nSrcSize, TCHAR*& rszDst, int& rnDstSize, int nMaxLineLength = 76) const;
  904.     void Decode(const TCHAR* szSrc, unsigned char*& rpDst, int& rnDstSize);
  905.  
  906.     static const TCHAR sm_EncodeArray\[\];
  907.     static const TCHAR sm_DecodeArray\[\];
  908.  
  909.     int                m_nSize;
  910.     unsigned char*    m_pData;
  911. };
  912.  
  913.  
  914. } // namespace altova
  915.  
  916. #endif // ALTOVA_SCHEMATYPES_H_INCLUDED
  917.