Changeset 2831 in Sophya for trunk/SophyaLib/HiStats/basedtable.h
- Timestamp:
- Nov 8, 2005, 5:16:44 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/basedtable.h
r2827 r2831 18 18 #include "dvlist.h" 19 19 #include "segdatablock.h" 20 #include "tvector.h" 20 21 21 22 namespace SOPHYA { … … 31 32 FloatField=3, DoubleField=4, 32 33 ComplexField=5, DoubleComplexField=6, 33 StringField=7, Date Field=8};34 StringField=7, DateTimeField=8}; 34 35 // <=====================================================> 35 36 37 //! Return the column type as a string (long or short depending on fgl=true/false) 36 38 static string ColTypeToString(FieldType ft, bool fgl=false); 39 //! Return the column type corresponding to \b sctyp 40 static FieldType StringToColType(string const & sctyp); 37 41 38 42 // constructeur , destructeur … … 82 86 inline sa_size_t AddStringColumn(string const & cnom) 83 87 { return AddColumn(StringField, cnom); } 88 //! Adds a column holding Date/Time value, named \b cnom 89 inline sa_size_t AddDateTimeColumn(const char * cnom) 90 { return AddColumn(DateTimeField, cnom); } 91 //! Adds a column holding Date/Time value, named \b cnom 92 inline sa_size_t AddDateTimeColumn(string const & cnom) 93 { return AddColumn(DateTimeField, cnom); } 84 94 85 95 inline sa_size_t AddColumn(FieldType ft, const char * cnom) … … 124 134 virtual MuTyV * GetLine(sa_size_t n) const ; 125 135 136 //! Return the information stored in column \b k of the table, converted to double 137 virtual TVector<r_8> GetColumnD(sa_size_t k) const ; 138 139 //! Return the information stored in column named \b nom of the table, converted to double 140 inline TVector<r_8> GetColumnD(char const * nom) const 141 { return GetColumnD(IndexNom(nom)) ; } 142 //! Return the information stored in column named \b nom of the table, converted to double 143 inline TVector<r_8> GetColumnD(string const & nom) const 144 { return GetColumnD(IndexNom(nom)) ; } 145 126 146 //! Return the index for column name \b nom 127 147 sa_size_t IndexNom(char const* nom) const ; … … 146 166 virtual void Clear() = 0; 147 167 148 //! Prints the table content - NOT YET IMPLEMENTED ! 149 void Print(int num, int nmax=1) const ; 150 151 //! Prints table definition and number of entries 168 //! Prints the table content (ascii dump) 169 virtual ostream& Print(ostream& os, sa_size_t lstart, sa_size_t lend, 170 sa_size_t lstep=1) const ; 171 //! Prints the table content (ascii dump) on stream \b os 172 inline ostream& Print(ostream& os) const 173 { return Print(os, 0, NEntry(), 1); } 174 //! Prints the table content (ascii dump) on stream \b os 175 inline ostream& WriteASCII(ostream& os) const 176 { return Print(os, 0, NEntry(), 1); } 177 178 179 //! Prints table definition and number of entries 152 180 void Show(ostream& os) const ; 153 181 //! Prints table definition and number of entries on the standard output stream \b cout 154 182 inline void Show() const { Show(cout) ; } 155 183 184 //! Return the associated DVList (info) object. 156 185 DVList& Info() const ; 157 186 158 187 // Remplissage depuis fichier ASCII 159 int FillFromASCIIFile(string const& fn);188 sa_size_t FillFromASCIIFile(istream& is, char clm='#', const char* sep=" \t"); 160 189 161 190 //------------------------------------------------------------- … … 175 204 virtual string LineHeaderToString() const; 176 205 virtual string LineToString(sa_size_t n) const; 206 207 //! Return a table row (line), formatted and converted to a string 208 virtual string TableRowToString(sa_size_t n, bool qstr, const char* sep=" ", 209 int fw=12) const; 177 210 178 211 // Pour la gestion de persistance PPF
Note:
See TracChangeset
for help on using the changeset viewer.