TString.h 912 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2010 Nokia Corporation.
  3. */
  4. #ifndef __CTSTRING__
  5. #define __CTSTRING__
  6. #include "TBase.h"
  7. // helpers
  8. // returns 1 if one of the strings exist.
  9. TSDWORD strBegin( const TSBYTE* str, const TSBYTE* match );
  10. TSDWORD cmpString( const TSBYTE *s1, const TSBYTE *s2 );
  11. class CTString {
  12. public:
  13. CTString( TSBYTE *initial = 0 );
  14. ~CTString();
  15. void set( const TSBYTE *set );
  16. TSDWORD length( const TSBYTE *str = 0);
  17. void insert( const TSBYTE *test, TSDWORD pos=-1 );
  18. void emphty();
  19. void erase( TSDWORD beg, TSDWORD end );
  20. void eraseLast();
  21. inline TSBYTE *getStr() { return mData; }
  22. static TDWORD cstr_getHex( TSBYTE v );
  23. static TDWORD cstr_scanColour( const TSBYTE *string, TDWORD def = 0 );
  24. static TDWORD cstr_scanShortColour( const TSBYTE *string, TDWORD def = 0 );
  25. protected:
  26. TSBYTE *mData;
  27. };
  28. #endif