00001 #ifndef SelectedCols_H
00002 #define SelectedCols_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 <vector>
00029
00030 #include <suplibxx/str.h>
00031 #include <Exception/Exception.h>
00032 #include <rdbxx/RDB.h>
00033
00034 #include "Options.h"
00035
00047 using namespace std;
00048
00049 class SelectedCols {
00050
00051 friend ostream& operator << ( ostream& os, SelectedCols& a ) {
00052 a.print( os );
00053 return os;
00054 }
00055
00056 friend ostream& operator << ( ostream& os, SelectedCols* a ) {
00057 a->print( os );
00058 return os;
00059 }
00060
00061 public:
00062
00064 SelectedCols( const vector< string >& cols, RDB& rdbtable,
00065 clo::parser& clo ) throw( Exception );
00066
00068 SelectedCols( RDB& rdbtable, clo::parser& clo ) throw( Exception );
00069
00070 const vector< string >& get_selected_cols( ) const { return selected_cols; }
00071
00072 void print( ostream& os ) const;
00073
00074 protected:
00075
00076
00077 vector< string > selected_cols;
00078
00079 private:
00080
00082 bool is_column_numeric( const string& colname, RDB& rdbtable )
00083 throw( Exception );
00084
00086 bool is_column_numeric( const string& colname, RDB& rdbtable,
00087 const clo::options& options ) throw ( Exception );
00088
00089 bool is_groupie( const string& name, const vector<string>& groupies );
00090
00091 void toggle_column_definition( const string& colname, RDB& rdbtable )
00092 const throw ( Exception );
00093
00094 };
00095
00096 #endif