ulib  1.0
S.W. Lee's essential C++ library
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
ustringlist.h
Go to the documentation of this file.
1 
11 #ifndef ___ustringlist___
12 #define ___ustringlist___
13 
14 #include <string.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include "ustring.h"
18 #include "ulist.h"
19 
20 #define DELIMETER_CHARS " #$%@*\n\t\"'-+=!?,./%<>()[]{}:;|"
21 
22 
23 namespace ulib {
24 
26 
35 
36  class CUStringList : public CUList
37  {
38  public:
39  CUStringList();
40  CUStringList( CUString str, CUString delimeter );
41  ~CUStringList();
42 
43  public:
44 
45  void PushFront( const CUString &arg_str );
46  void PushBack( const CUString &arg_str );
47  void RemoveFront();
48  void RemoveBack();
49  bool IsEmpty();
50  int Find( char str[] );
51  bool PopFront( CUString &ret_str );
52  bool PopBack( CUString &ret_str );
53  bool PopAt( int nPos, CUString &ret_str );
54  bool PopAt( int nPos );
55  bool GetAt( int nPos, CUString &ret_str );
56  char *GetAt( int nPos );
57  bool SetAt( int nPos, CUString &str );
58  bool SetAt( int nPos, char *str );
59 
60  void TokenizeByChar( CUString str, CUString delimeter, bool permit_empty = true );
61  void TokenizeByStr( CUString str, CUString delimeter, bool permit_empty = true );
62  void TokenizeByBoundTag( CUString str, CUString open_tag, CUString close_tag, bool permit_empty = true );
63  void GetIntersection( CUStringList &list1, CUStringList &list2 );
64 
65  CUString ToString( char delimeter[] = " ");
66 
67  void Print( FILE *fp, char delimeter[] = "\n" );
68  void PrintEx( FILE *fp, char delimeter[] = "\n" );
69 
70  void Clear();
71 
72  };
73 
74 }
75 
76 #endif
77