#include "gstlearn_export.hpp"
#include "geoslib_define.h"
#include "Basic/VectorT.hpp"
#include "Basic/VectorNumT.hpp"
Macros | |
#define | SPACES " \t\r\n" |
Functions | |
GSTLEARN_EXPORT void | skipBOM (std::ifstream &ins) |
GSTLEARN_EXPORT String | toUpper (const std::string_view string) |
GSTLEARN_EXPORT String | toLower (const std::string_view string) |
GSTLEARN_EXPORT void | toUpper (String &string) |
GSTLEARN_EXPORT void | toLower (String &string) |
GSTLEARN_EXPORT bool | matchKeyword (const String &string1, const String &string2, bool caseSensitive=true) |
GSTLEARN_EXPORT bool | matchRegexp (const String &string1, const String &string2, bool caseSensitive=true) |
GSTLEARN_EXPORT int | getRankInList (const VectorString &list, const String &match, bool caseSensitive=true) |
GSTLEARN_EXPORT int | decodeInString (const String &symbol, const String &node, int *facies, bool caseSensitive=true) |
GSTLEARN_EXPORT int | decodeInList (const VectorString &symbols, const String &node, int *rank, int *facies, bool caseSensitive=true) |
GSTLEARN_EXPORT void | correctNamesForDuplicates (VectorString &list) |
GSTLEARN_EXPORT void | correctNewNameForDuplicates (VectorString &list, int rank) |
GSTLEARN_EXPORT String | incrementStringVersion (const String &string, int rank=1, const String &delim=".") |
GSTLEARN_EXPORT String | concatenateString (const String &string, double value, const String &delim="-") |
GSTLEARN_EXPORT String | concatenateStrings (const String &delimt=".", const String &string1="", const String &string2="", const String &string3="", const String &string4="") |
GSTLEARN_EXPORT VectorString | generateMultipleNames (const String &radix, int number, const String &delim="-") |
GSTLEARN_EXPORT VectorString | expandList (const VectorString &list, const String &match, bool onlyOne=false) |
GSTLEARN_EXPORT VectorString | expandList (const VectorString &list, const VectorString &matches) |
GSTLEARN_EXPORT int | getMaxStringSize (const VectorString &list) |
GSTLEARN_EXPORT VectorString | separateKeywords (const String &code) |
GSTLEARN_EXPORT int | toInteger (const String &v) |
GSTLEARN_EXPORT double | toDouble (const String &v, char dec='.') |
GSTLEARN_EXPORT String | toString (int value) |
GSTLEARN_EXPORT String | toString (double value) |
GSTLEARN_EXPORT int | askInt (const String &text, int defval=ITEST, bool authTest=false) |
GSTLEARN_EXPORT double | askDouble (const String &text, double defval=TEST, bool authTest=false) |
GSTLEARN_EXPORT int | askBool (const String &text, bool defval=false) |
GSTLEARN_EXPORT String | trimRight (const String &s, const String &t=SPACES) |
GSTLEARN_EXPORT String | trimLeft (const String &s, const String &t=SPACES) |
GSTLEARN_EXPORT String | trim (const String &s, const String &t=SPACES) |
GSTLEARN_EXPORT String | erase (const String &s, const String &t=SPACES) |
GSTLEARN_EXPORT VectorInt | decodeGridSorting (const String &string, const VectorInt &nx, bool verbose=false) |
GSTLEARN_EXPORT char * | gslStrcpy (char *dst, const char *src) |
GSTLEARN_EXPORT char * | gslStrcat (char *dst, const char *src) |
GSTLEARN_EXPORT int | gslSPrintf (char *dst, const char *fmt,...) |
GSTLEARN_EXPORT char * | gslStrtok (char *str, const char *delim) |
GSTLEARN_EXPORT char * | gslStrncpy (char *dest, const char *src, size_t n) |
GSTLEARN_EXPORT int | gslScanf (const char *format,...) |
GSTLEARN_EXPORT int | gslSScanf (const char *str, const char *format,...) |
GSTLEARN_EXPORT int | gslFScanf (FILE *stream, const char *format,...) |
#define SPACES " \t\r\n" |
GSTLEARN_EXPORT int askBool | ( | const String & | text, |
bool | defval | ||
) |
Ask interactively for the value of one boolean
text | Text of the question |
defval | Default value |
GSTLEARN_EXPORT double askDouble | ( | const String & | text, |
double | defval, | ||
bool | authTest | ||
) |
Ask interactively for the value of one Real (Double)
text | Text of the question |
defval | Default value (or IFFFF) |
authTest | True if a TEST answer is authorized (TEST) |
GSTLEARN_EXPORT int askInt | ( | const String & | text, |
int | defval, | ||
bool | authTest | ||
) |
Ask interactively for the value of one integer
text | Text of the question |
defval | Default value (or IFFFF) |
authTest | True if TEST value is authorized (TEST) |
GSTLEARN_EXPORT String concatenateString | ( | const String & | string, |
double | value, | ||
const String & | delim = "-" |
||
) |
GSTLEARN_EXPORT String concatenateStrings | ( | const String & | delimt = "." , |
const String & | string1 = "" , |
||
const String & | string2 = "" , |
||
const String & | string3 = "" , |
||
const String & | string4 = "" |
||
) |
GSTLEARN_EXPORT void correctNamesForDuplicates | ( | VectorString & | list | ) |
Check that the names in 'list' are not conflicting with any previous name. If it does, increment its name by a version number.
list |
GSTLEARN_EXPORT void correctNewNameForDuplicates | ( | VectorString & | list, |
int | rank | ||
) |
GSTLEARN_EXPORT VectorInt decodeGridSorting | ( | const String & | string, |
const VectorInt & | nx, | ||
bool | verbose | ||
) |
Decode the grid sorting order
[in] | string | Name of the sorting string |
[in] | nx | Array giving the number of cells per direction |
[in] | verbose | Verbose flag |
GSTLEARN_EXPORT int decodeInList | ( | const VectorString & | symbols, |
const String & | node, | ||
int * | rank, | ||
int * | facies, | ||
bool | caseSensitive | ||
) |
Decode the input string 'node' as a one-character keyword followed by an integer rank The keyword must match one of the symbols: its rank is 'rank' The integer rank is returned as 'facies'
symbols | |
node | |
rank | |
facies | |
caseSensitive |
GSTLEARN_EXPORT int decodeInString | ( | const String & | symbol, |
const String & | node, | ||
int * | facies, | ||
bool | caseSensitive | ||
) |
Decode the input string 'node' as a one-character keyword followed by an integer rank The keyword must match the symbol. The integer rank is returned as 'facies'
symbol | |
node | |
facies | |
caseSensitive |
GSTLEARN_EXPORT VectorString expandList | ( | const VectorString & | list, |
const String & | match, | ||
bool | onlyOne | ||
) |
Returns the list of matching names
list | List of eligible names |
match | Name to be expanded |
onlyOne | True if the expanded list may only contain a single name |
GSTLEARN_EXPORT VectorString expandList | ( | const VectorString & | list, |
const VectorString & | matches | ||
) |
GSTLEARN_EXPORT VectorString generateMultipleNames | ( | const String & | radix, |
int | number, | ||
const String & | delim = "-" |
||
) |
GSTLEARN_EXPORT int getMaxStringSize | ( | const VectorString & | list | ) |
Returns the maximum string size of a list of strings
list | List of strings |
GSTLEARN_EXPORT int getRankInList | ( | const VectorString & | list, |
const String & | match, | ||
bool | caseSensitive | ||
) |
Return the rank of the (first) item in 'list' which matches 'match'
list | List of keywords used for search |
match | Searched pattern |
caseSensitive | Case Sensitive flag |
GSTLEARN_EXPORT int gslFScanf | ( | FILE * | stream, |
const char * | format, | ||
... | |||
) |
GSTLEARN_EXPORT int gslScanf | ( | const char * | format, |
... | |||
) |
GSTLEARN_EXPORT int gslSPrintf | ( | char * | dst, |
const char * | fmt, | ||
... | |||
) |
GSTLEARN_EXPORT int gslSScanf | ( | const char * | str, |
const char * | format, | ||
... | |||
) |
GSTLEARN_EXPORT char* gslStrcat | ( | char * | dst, |
const char * | src | ||
) |
GSTLEARN_EXPORT char* gslStrcpy | ( | char * | dst, |
const char * | src | ||
) |
GSTLEARN_EXPORT char* gslStrncpy | ( | char * | dest, |
const char * | src, | ||
size_t | n | ||
) |
GSTLEARN_EXPORT char* gslStrtok | ( | char * | str, |
const char * | delim | ||
) |
GSTLEARN_EXPORT String incrementStringVersion | ( | const String & | string, |
int | rank = 1 , |
||
const String & | delim = "." |
||
) |
GSTLEARN_EXPORT bool matchKeyword | ( | const String & | string1, |
const String & | string2, | ||
bool | caseSensitive | ||
) |
Check if two keywords are similar, up to their case
string1 | First keyword |
string2 | Second keyword |
caseSensitive | true if the case of both strings should be considered Otherwise, both strings are converted into upper case before comparison |
GSTLEARN_EXPORT bool matchRegexp | ( | const String & | string1, |
const String & | string2, | ||
bool | caseSensitive | ||
) |
Check if two keywords match up to "Regular Expression" on the second string and their case
string1 | First keyword |
string2 | Second keyword (through Regular Expression interpretation) |
caseSensitive | true if the case of both strings should be considered Otherwise, both strings are converted into upper case before comparison |
GSTLEARN_EXPORT VectorString separateKeywords | ( | const String & | code | ) |
Separate keywords in the input string The keywords are identified when switching between alpha, digit and other
code | String to be split |
GSTLEARN_EXPORT void skipBOM | ( | std::ifstream & | ins | ) |
This file contains all the OLD-STYLE declarations causing warnings on Windows They should gradually be replaced by modern statements However, they are kept there to keep track on these statements
GSTLEARN_EXPORT double toDouble | ( | const String & | v, |
char | dec = '.' |
||
) |
GSTLEARN_EXPORT int toInteger | ( | const String & | v | ) |
Decode an integer from a string. Returns ITEST if impossible
v | String to be decoded |
GSTLEARN_EXPORT String toLower | ( | const std::string_view | string | ) |
GSTLEARN_EXPORT void toLower | ( | String & | string | ) |
GSTLEARN_EXPORT String toString | ( | double | value | ) |
GSTLEARN_EXPORT String toString | ( | int | value | ) |
GSTLEARN_EXPORT String toUpper | ( | const std::string_view | string | ) |
GSTLEARN_EXPORT void toUpper | ( | String & | string | ) |