31 typedef std::multimap<std::string, unsigned int, StringLess>
tIndex;
86 #ifdef VLAD_SECOND_ITTABLE
102 #ifdef VLAD_SECOND_ITTABLE
189 ISTable(
const std::string& name,
301 inline const std::string&
GetName()
const;
316 void SetName(
const std::string& name);
392 void AddColumn(
const std::string& colName,
393 const std::vector<std::string>& col = std::vector<std::string>());
438 const std::string& afColName,
const std::vector<std::string>& col =
439 std::vector<std::string>());
470 const std::vector<std::string>& col);
490 void GetColumn(std::vector<std::string>& col,
const std::string& colName);
523 void GetColumn(std::vector<std::string>& col,
const std::string& colName,
524 const unsigned int fromRowIndex,
unsigned int toRowIndex);
549 void GetColumn(std::vector<std::string>& col,
const std::string& colName,
550 const std::vector<unsigned int>& rowIndex);
575 const std::string& newColName);
664 unsigned int AddRow(
const std::vector<std::string>& row =
665 std::vector<std::string>());
713 unsigned int InsertRow(
const unsigned int atRowIndex,
714 const std::vector<std::string>& row = std::vector<std::string>());
740 void FillRow(
const unsigned int rowIndex,
741 const std::vector<std::string>& row);
782 void GetRow(std::vector<std::string>& row,
const unsigned int rowIndex,
783 const std::string& fromColName = std::string(),
784 const std::string& toColName = std::string());
802 const std::vector<std::string>&
GetRow(
const unsigned int rowIndex);
819 void ClearRow(
const unsigned int rowIndex);
839 void DeleteRow(
const unsigned int rowIndex);
858 void DeleteRows(
const std::vector<unsigned int>& rows);
898 void UpdateCell(
const unsigned int rowIndex,
const std::string& colName,
899 const std::string& value);
922 const std::string&
operator()(
const unsigned int rowIndex,
923 const std::string& colName)
const;
949 void SetFlags(
const std::string& colName,
const unsigned char flags);
968 unsigned char GetDataType(
const std::string& colName);
998 unsigned int FindFirst(
const std::vector<std::string>& targets,
999 const std::vector<std::string>& colNames,
1000 const std::string& indexName = std::string());
1025 void Search(std::vector<unsigned int>& res,
const std::string& target,
1026 const std::string& colName,
const unsigned int fromRowIndex = 0,
1059 void Search(std::vector<unsigned int>& res,
1060 const std::vector<std::string>& targets,
1061 const std::vector<std::string>& colNames,
1062 const unsigned int fromRowIndex = 0,
1065 const std::string& indexName = std::string());
1099 unsigned int> >& duplRows,
const std::vector<std::string>& colNames,
1146 void Read(
unsigned int indexInFile);
1158 unsigned int typeOfMerge = 0);
1168 inline bool IndexExists(
const std::string& indexName);
1174 const std::vector<std::string>& colNames,
1175 const unsigned int unique = 0);
1180 void UpdateIndex(
const std::string& indexName,
const unsigned int rowIndex);
1205 void CreateKey(
const std::vector<std::string>& colNames);
1215 static void SetUnion(
const std::vector<unsigned int>& a,
1216 const std::vector<unsigned int>& b, std::vector<unsigned int>& ret);
1221 static void SetIntersect(
const std::vector<unsigned int>& a,
1222 const std::vector<unsigned int>& b, std::vector<unsigned int>& ret);
1228 const std::vector<std::string>& colNames);
1233 void GetColumn(std::vector<std::string>& col,
const std::string& colName,
1234 const std::string& indexName);
1237 static const unsigned int MAX_NUM_ITTABLE_ROWS = 1000;
1240 static const unsigned int EXPONENT = 4;
1241 static const unsigned int MAX_PRECISION = DBL_DIG;
1243 static const unsigned int MANTISSA = MAX_PRECISION + 2;
1244 static const unsigned int INT_LIMIT = 11;
1247 static const unsigned char DT_MASK = 15 << 4;
1249 static const unsigned char SC_MASK = 0x01;
1251 static const unsigned char WS_MASK = 0x02;
1252 static const unsigned char LAST_DT_VALUE = 3;
1253 static const unsigned int DEFAULT_PRECISION = MAX_PRECISION;
1254 static const unsigned char DEFAULT_OPTIONS;
1256 static const std::string _version;
1260 std::vector<ITTable> _ittables;
1268 std::vector<unsigned int> _precision;
1269 std::vector<unsigned char> _compare_opts;
1271 std::vector<std::string> _indexNames;
1272 std::vector<std::vector<unsigned int> > _listsOfColumns;
1273 std::vector<unsigned int> _unique;
1279 unsigned int _numRows;
1281 mutable unsigned int _rowIndexCache;
1282 mutable std::pair<unsigned int, unsigned int> _rowLocCache;
1284 void InsertColumn(
const std::string& colName,
const unsigned int atColIndex,
1285 const std::vector<std::string>& col = std::vector<std::string>());
1286 void CreateColumn(
const std::string& colName,
const unsigned int atColIndex,
1287 const std::vector<std::string>& col = std::vector<std::string>());
1288 int UpdateCell(
const std::string& cell,
const unsigned int colIndex,
1289 const unsigned int rowIndex);
1290 const std::string&
operator()(
const unsigned int rowIndex,
1291 const unsigned int colIndex)
const;
1292 int SetFlags(
const unsigned char newOpts,
const unsigned int colIndex);
1294 std::vector<std::pair<unsigned int, unsigned int> >& duplRows,
1296 void VerifyColumnsIndices(
const std::vector<unsigned int>& colIndices);
1297 bool AreListsOfColumnsValid(
const std::vector<unsigned int>& colIndices);
1299 const std::vector<unsigned int>& colIndices,
1300 const unsigned int unique = 0);
1301 void CreateKey(
const std::vector<unsigned int>& colIndices);
1302 unsigned int FindFirst(
const std::vector<std::string>& targets,
1303 const std::vector<unsigned int>& colIndices,
1304 const std::string& indexName = std::string());
1305 void Search(std::vector<unsigned int>& res,
1306 const std::vector<std::string>& targets,
1307 const std::vector<unsigned int>& colIndices,
1308 const unsigned int fromRowIndex = 0,
1311 const std::string& indexName = std::string());
1317 GetCompareType(
const std::vector<unsigned int>& colIndices);
1319 std::string CellValue(
const unsigned int colIndex,
1320 const unsigned int rowIndex);
1321 std::string ConvertString(
const std::string& value,
1322 const unsigned int colIndex);
1323 std::string MultiStringsValue(
const std::vector<std::string>& values,
1324 const std::vector<unsigned int>& colIndices);
1325 std::string SubRowValue(
const std::vector<unsigned int>& colIndices,
1326 const unsigned int rowIndex);
1327 std::string AggregateRow(
const std::vector<unsigned int>& colIndices,
1328 const unsigned int rowIndex);
1330 inline void AppendToAndDelimit(std::string& to,
1331 const std::string& appending);
1333 void ValidateOptions(
unsigned int colIndex);
1335 std::string CreateInternalIndexName(
const unsigned int indexIndex);
1337 const unsigned int rowIndex);
1339 void ClearIndex(
const unsigned int indexIndex);
1342 int FindIndex(
const std::string& indexName);
1343 int FindIndex(
const std::vector<unsigned int>& colIndices);
1345 void UpdateIndices(
const unsigned int rowIndex);
1346 void ClearIndices();
1348 bool IsColumnInIndex(
const unsigned int indexIndex,
1349 const unsigned int colIndex);
1353 void UpdateColListOnColInsert(
const unsigned int colIndex);
1354 void UpdateColListOnColDelete(
const unsigned int colIndex);
1355 void UpdateColListOnCellUpdate(
const unsigned int rowIndex,
1356 const unsigned int colIndex);
1358 unsigned int FindFirst(
const std::vector<std::string>& targets,
1359 const std::vector<unsigned int>& colIndices,
1360 const unsigned int indexIndex);
1373 void ConvertToInt(
const std::string& a, std::string& ret);
1374 void ConvertDouble(
const std::string& a, std::string& ret);
1375 void ConvertToLowerNoWhiteSpace(
const std::string& a, std::string& ret);
1377 void GetRowLocation(std::pair<unsigned int, unsigned int>& rowLoc,
1378 const unsigned int rowIndex)
const;
1379 void CacheRowLocation(
const unsigned int rowIndex)
const;
1381 void CreateSubtables(
const unsigned int numRows);
1382 void CreateSubtableColumns(
const unsigned int colIndex,
1383 const std::vector<std::string>& col);
1384 void CreateColumn(
const unsigned int atColIndex,
1385 const std::vector<std::string>& col);
1387 void Print(
const std::string& indexName);
1389 unsigned int GetColumnIndex(
const std::string& colName)
const;
1408 return(_indexNames.size());
1416 int ret = FindIndex(indexName);
1430 inline void ISTable::AppendToAndDelimit(std::string& to,
1431 const std::string& appending)
1443 _modified = modified;
1467 return(_colNames.
size());
1473 return(_colCaseSense);