home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / C_C++ / VisualProgrammingArmoury / data1.cab / MyFileGroup / INCLUDE / String.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-23  |  3.7 KB  |  104 lines

  1. #ifndef _INC_STRING_HPP
  2. #define _INC_STRING_HPP
  3. #ifdef __GNUG__
  4.  
  5. #ifdef BUILD_TCCORE
  6. #define TCCORELIB    dllexport
  7. #else
  8. #ifdef BUILD_LOCAL
  9. #define TCCORELIB
  10. #else
  11. #define TCCORELIB    dllimport
  12. #endif
  13. #endif
  14.  
  15. #else
  16.  
  17. #ifdef BUILD_TCCORE
  18. #define TCCORELIB    __declspec(dllexport)
  19. #else
  20. #ifdef BUILD_LOCAL
  21. #define TCCORELIB
  22. #else
  23. #define TCCORELIB    __declspec(dllimport)
  24. #endif
  25. #endif
  26.  
  27. #endif
  28.  
  29. // **********************************************************************
  30. class TCCORELIB TC_CString 
  31. {
  32. friend TCCORELIB BOOL operator == (const char *s1, const TC_CString & s2);
  33. private:
  34. union
  35. {
  36.     char isAlloc;
  37.     char buffer[16];
  38.     struct
  39.     {
  40.         UINT dummy1;
  41.         UINT mem;
  42.         char * ptr;
  43.     }
  44.     a;
  45. };
  46. private:  void _Init ()  ;
  47. public:  void _Free ()  ;
  48. public:   TC_CString ()  ;
  49. public:   TC_CString (const TC_CString & src)  ;
  50. public:   TC_CString (const char * str)  ;
  51. public:   TC_CString (int length)  ;
  52. public:   ~TC_CString ()  ;
  53. public:  void Set (const char * str_)  ;
  54. public:  void SetLen (int size)  ;
  55. public:  char* Get ()  ;
  56. public:  int Len ()  ;
  57. public:   operator const char* ()  ;
  58. public:  TC_CString & operator += (const char * str_)  ;
  59. public:  TC_CString & operator += ( const char chr )  ;
  60. public:  TC_CString & operator += (const TC_CString & str)  ;
  61. public:  TC_CString & operator = (const TC_CString & str)  ;
  62. public:  TC_CString & operator = (const char * str)  ;
  63.  
  64. }; // end of class TC_CString
  65.  
  66. // **********************************************************************
  67. TCCORELIB TC_CString operator + (const TC_CString & s1, const TC_CString & s2)  ;
  68. TCCORELIB TC_CString operator + (const TC_CString & s1, const char *s2)  ;
  69. TCCORELIB TC_CString operator + (const char *s1, const TC_CString & s2)  ;
  70. TCCORELIB BOOL operator == (const TC_CString &s1, const TC_CString &s2)  ;
  71. TCCORELIB BOOL operator == (const TC_CString &s1, const char *s2)  ;
  72. TCCORELIB BOOL operator == (const char *s1, const TC_CString & s2)  ;
  73. TCCORELIB BOOL operator != (const TC_CString & s1, const TC_CString & s2)  ;
  74. TCCORELIB BOOL operator != (const TC_CString & s1, const char *s2)  ;
  75. TCCORELIB BOOL operator != (const char *s1, const TC_CString & s2)  ;
  76. TCCORELIB int tcLastIndexOf (LPCSTR src, int chr)  ;
  77. TCCORELIB TC_CString tcSubString (LPCSTR src, int start, int end=-1)  ;
  78.  extern  TCCORELIB char tc_sNull [];
  79. TCCORELIB TC_CString tcStr (const char*str)  ;
  80. TCCORELIB TC_CString tcStr (long val,int radix=10)  ;
  81. TCCORELIB TC_CString tcStr (double val, int dec)  ;
  82. TCCORELIB void tcDtoa ( double doub_val,  int dec, char * buffer )  ;
  83. TCCORELIB char* tcStrTrimBegin (char* s)  ;
  84. TCCORELIB char* tcStrTrimEnd (char *s)  ;
  85. TCCORELIB char* tcStrTrim (char *s)  ;
  86. TCCORELIB TC_CString& tcStrTrim (TC_CString & str)  ;
  87. TCCORELIB TC_CString& tcStrInsert (TC_CString & src, LPCSTR str)  ;
  88. TCCORELIB int tcStrLastIndexOf (LPCSTR src, int chr)  ;
  89. TCCORELIB int tcStrLastIndexOf (LPCSTR src, LPCSTR key, BOOL caseignore=FALSE)  ;
  90. TCCORELIB int tcStrIndexOf (LPCSTR src, LPCSTR key, BOOL caseignore=FALSE)  ;
  91. TCCORELIB TC_CString tcStrSubString (LPCSTR src, int start, int end=-1)  ;
  92. TCCORELIB BOOL tcStrEndsWith (LPCSTR src, LPCSTR end, BOOL caseignore=FALSE)  ;
  93. TCCORELIB BOOL tcStrStartsWith (LPCSTR src, LPCSTR start, BOOL caseignore=FALSE)  ;
  94. TCCORELIB char* _tcVSprintf (const char * fmt, va_list arg_ptr)  ;
  95. TCCORELIB void _tcSprintfLock ()  ;
  96. TCCORELIB void _tcSprintfUnlock ()  ;
  97. TCCORELIB TC_CString tcSPrintf (LPCSTR fmt, ...)  ;
  98. TCCORELIB TC_CString tcVSPrintf (const char * fmt, va_list arg_ptr)  ;
  99. TCCORELIB TC_CString& tcCSPrintf (TC_CString &dst, LPCSTR fmt, ...)  ;
  100. TCCORELIB TC_CString& tcCVSPrintf (TC_CString &dst, const char * fmt, va_list arg_ptr)  ;
  101. TCCORELIB void winout (LPCSTR fmt, ... )  ;
  102.  
  103. #endif // _INC_STRING_HPP
  104.