00001 00002 #ifndef __paramlist_hpp__ 00003 #define __paramlist_hpp__ 00004 00005 #include <stdio.h> 00006 #include <vector> 00007 00008 #include <crbn/basic/basic.h> 00009 00010 typedef struct _param param; 00011 00012 class paramlist 00013 { 00014 public: 00015 paramlist(); 00016 ~paramlist(); 00017 00018 void clear(); 00019 uint32 size(); 00020 00021 bool push_int( int32 value ); 00022 bool push_float( float value ); 00023 bool push_int_pointer( uint32 size, int32* value, bool freeit = false ); 00024 bool push_float_pointer( uint32 size, float* value, bool freeit = false ); 00025 bool push_string( char* value, bool freeit = false ); 00026 00027 bool get_int( uint32 index, int32& value ); 00028 bool get_float( uint32 index, float& value ); 00029 bool get_int_pointer( uint32 index, uint32& size, int32*& value ); 00030 bool get_float_pointer( uint32 index, uint32& size, float*& value ); 00031 bool get_string( uint32 index, char*& value ); 00032 00033 void print( FILE* fp ); 00034 00035 int32 search_string( char* value ); 00036 void remove( uint32 index ); 00037 00038 private: 00039 std::vector<param> _list; 00040 }; 00041 00042 #endif // __paramlist_hpp__