StringPar.h
00001 #ifndef STRINGPAR_H
00002 #define STRINGPAR_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "Par.h"
00029
00035 class StringPar : public Par {
00036
00037 public:
00038
00039 ~StringPar( ) { }
00040
00041 StringPar( ) : Par( ) { }
00042
00046 StringPar( const StringPar& par ) : Par( par ) { }
00047
00048
00049 StringPar( ParTxt& par ) throw ( ParFileException );
00050
00051 void pgetstr( char result[], size_t size ) const throw ( ParFileException ) {
00052 strncpy( result, parameter[ PARVALUE ].c_str( ), size );
00053 result[ size ] = '\0';
00054 }
00055
00056 string pgetstring( ) const throw ( ParFileException ) {
00057 return parameter[ PARVALUE ];
00058 }
00059
00063 void print( ostream& os ) const;
00064
00065 void set_val( const string& str ) throw ( ParFileException, Exception );
00066
00067 private:
00068
00069 void between_limits( const string& t ) const
00070 throw ( ParFileException, Exception );
00071
00072 void validate( const string& ) const throw ( ParFileException ) {
00073 return;
00074 }
00075
00076 };
00077
00078 #endif