File: npstringarray.h

package info (click to toggle)
peruser 4b33-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,952 kB
  • ctags: 1,064
  • sloc: cpp: 22,367; perl: 2,733; makefile: 345; sh: 335
file content (37 lines) | stat: -rw-r--r-- 755 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class NP_Stringarray
{
   char error_message[ 1024 ];
   
   char **item_list;

   int total, duplicates_allowed, mutex;
   
 public:

   NP_Stringarray();
   ~NP_Stringarray();
   
   int add_item( const char * );
   int get_total();
   
   const char *operator[]( int );
   int operator[]( const char * );

   int allow_duplicates( int );
   
   int replace_item( int, const char * );
   int replace_item( const char *, const char * );

   int reassign_item( int, const char * );
   int reassign_item( const char *, const char * );

   int remove_item( const char * );
   int remove_item( int );

   int sort();
   int clear();
   
   char *get_error() { return error_message; };
   void print_error() { fprintf( stderr, "%s\n", error_message ); };
};