20#include "../utils/tools.hpp"
34 if (i <= j &&
sStrings[col].size() <= (
size_t)i)
36 else if (i < j &&
sStrings[col].size() <= (
size_t)j)
38 else if (i > j &&
sStrings[col].size() <= (
size_t)j)
40 else if (i > j &&
sStrings[col].size() <= (
size_t)i)
67 if (
sStrings[col].size() <= (
size_t)line)
81 bool bReturnIndex =
false;
107 for (
int i = i1; i <= i2; i++)
114 for (
int i = j1; i <= j2; i++)
116 if (!
qSort(&vIndex[0], i2-i1+1, i, 0, i2-i1, nSign))
131 for (
int j = i1; j <= i2; j++)
152 while (sCols.length())
161 if (keys->
nKey[1] == -1)
166 for (
int j = keys->
nKey[0]; j < keys->nKey[1]; j++)
168 if (!
qSort(&vIndex[0], i2-i1+1, j+j1, 0, i2-i1, nSign))
195 if (subKeyList->
nKey[1] == -1)
196 subKeyList->
nKey[1] = subKeyList->
nKey[0]+1;
198 for (
int _j = subKeyList->
nKey[0]; _j < subKeyList->nKey[1]; _j++)
203 subKeyList = subKeyList->
subkeys;
207 for (
int _j = i1; _j <= i2; _j++)
222 for (
int i = 0; i <= i2-i1; i++)
226 if (bError || !bReturnIndex)
227 return vector<int>();
237 string* sSortVector =
new string[i2-i1+1];
241 for (
int i = 0; i <= i2-i1; i++)
243 sSortVector[i] =
sStrings[j1][vIndex[i]];
248 for (
int i = 0; i <= i2-i1; i++)
250 sStrings[j1][i+i1] = sSortVector[i];
254 delete[] sSortVector;
269 if (_sString.length())
272 for (
unsigned int i = 0; i <= nCol; i++)
276 if (_nthString == string::npos)
300 if (_sString.length())
332 if (_nthString == string::npos)
366 for (
unsigned int i = i1+1; i < i2; i++)
394 for (
size_t i = 1; i < _vLine.
size(); i++)
422 for (
unsigned int i = i1+1; i < i2; i++)
450 for (
size_t i = 1; i < _vLine.
size(); i++)
478 for (
unsigned int i = i1; i < i2; i++)
505 for (
size_t i = 0; i < _vLine.
size(); i++)
std::string toLowerCase(const std::string &)
Converts uppercase to lowercase letters.
ColumnKeys * evaluateKeyList(std::string &sKeyList, long long int nColumnCount)
This public member function creates a ColumnKeys object from a string containing the hierarchical sor...
bool qSort(int *nIndex, int nElements, int nColumn, long long int nLeft, long long int nRight, int nSign)
This public member function is the interface to the quicksort algorithm, which itself is implemented ...
bool sortSubList(int *nIndex, int nElements, ColumnKeys *KeyList, long long int i1, long long int i2, long long int j1, int nSign, long long int nColumns)
This public member function handles the hierarchical sorting process of many columns together....
bool bSortCaseInsensitive
virtual int compare(int i, int j, int col) override
std::vector< int > sortElements(long long int i1, long long int i2, long long int j1, long long int j2, const std::string &sSortingExpression)
std::vector< std::vector< std::string > > sStrings
virtual bool isValue(int line, int col) override
void reorderColumn(const std::vector< int > &vIndex, long long int i1, long long int i2, long long int j1=0)
bool writeString(const std::string &_sString, unsigned int _nthString=std::string::npos, unsigned int nCol=0)
StringInternalMemory _stringIntMem
std::string maxString(unsigned int i1=0, unsigned int i2=std::string::npos, unsigned int nCol=0)
std::string readString(unsigned int _nthString=std::string::npos, unsigned int nCol=0)
std::string minString(unsigned int i1=0, unsigned int i2=std::string::npos, unsigned int nCol=0)
std::string sumString(unsigned int i1=0, unsigned int i2=std::string::npos, unsigned int nCol=0)
Common exception class for all exceptions thrown in NumeRe.
static size_t invalid_position
This class abstracts all the index logics, i.e. the logical differences between single indices and in...
int last() const
This member function returns the last index value, which can be reached by the values stored internal...
size_t size() const
This member function returns the size of the indices stored in this class.
bool isOpenEnd() const
This member function determines, whether the internal index set has an open end.
void setRange(int nMin, int nMax)
This member function can be used to force the indices stored internally to be in a defined interval....
int & front()
This member function returns a reference to the first index value stored internally.
int findParameter(const std::string &sCmd, const std::string &sParam, const char cFollowing)
This function searches the passed parameter in the passed command string. If something is found,...
Structure for the sorting functionality: used for the recursive definition of the index columns for s...