Scid  4.7.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions
misc.cpp File Reference
#include "common.h"
#include "misc.h"
#include <stdio.h>
#include <ctype.h>
#include <cmath>
Include dependency graph for misc.cpp:

Go to the source code of this file.

Functions

ecoT eco_FromString (const char *ecoStr)
 
void eco_ToString (ecoT ecoCode, char *ecoStr, bool extensions)
 
ecoT eco_BasicCode (ecoT eco)
 
ecoT eco_Reduce (ecoT eco)
 ecoReduce() - maps eco to a smaller set More...
 
ecoT eco_LastSubCode (ecoT eco)
 
void strCopyExclude (char *target, const char *original, const char *excludeChars)
 
char * strAppend (char *target, const char *extra)
 
char * strDuplicate (const char *original)
 
uint strPad (char *target, const char *original, int width, char padding)
 
const char * strFirstChar (const char *target, char matchChar)
 
const char * strLastChar (const char *target, char matchChar)
 
void strStrip (char *str, char ch)
 
const char * strTrimLeft (const char *target, const char *trimChars)
 
uint strTrimSuffix (char *target, char suffixChar)
 
void strTrimDate (char *str)
 
void strTrimMarkCodes (char *str)
 
void strTrimMarkup (char *str)
 
const char * strFirstWord (const char *str)
 
const char * strNextWord (const char *str)
 
bool strIsUnknownName (const char *str)
 
bool strIsSurnameOnly (const char *name)
 
bool strGetBoolean (const char *str)
 
void strGetIntegers (const char *str, int *results, uint nResults)
 
void strGetUnsigneds (const char *str, uint *results, uint nResults)
 
resultT strGetResult (const char *str)
 
flagT strGetFlag (const char *str)
 
squareT strGetSquare (const char *str)
 
int strUniqueExactMatch (const char *keyStr, const char **strTable, bool exact)
 

Function Documentation

◆ eco_BasicCode()

ecoT eco_BasicCode ( ecoT  eco)

Definition at line 110 of file misc.cpp.

◆ eco_FromString()

ecoT eco_FromString ( const char *  ecoStr)

Definition at line 36 of file misc.cpp.

◆ eco_LastSubCode()

ecoT eco_LastSubCode ( ecoT  eco)

Definition at line 143 of file misc.cpp.

◆ eco_Reduce()

ecoT eco_Reduce ( ecoT  eco)

ecoReduce() - maps eco to a smaller set

Parameters
ecothe eco value to convert (must be != 0)

Scid ECO subcodes use 131 values for each canonical ECO. For example A00 is divided in A00,A00a,A00a1,A00a2,A00a3,A00a4,A00b...A00z4 corresponding to eco values 1,2,3,4,5,6,7...131 (value 0 means no ECO). This functions will map subECOs like A00a1...A00a4 into A00a, reducing the 131 values to 27. The previous sequence will became 0,1,1,1,1,1,2...26

Definition at line 130 of file misc.cpp.

◆ eco_ToString()

void eco_ToString ( ecoT  ecoCode,
char *  ecoStr,
bool  extensions 
)

Definition at line 78 of file misc.cpp.

◆ strAppend()

char* strAppend ( char *  target,
const char *  extra 
)

Definition at line 189 of file misc.cpp.

◆ strCopyExclude()

void strCopyExclude ( char *  target,
const char *  original,
const char *  excludeChars 
)

Definition at line 163 of file misc.cpp.

◆ strDuplicate()

char* strDuplicate ( const char *  original)

Definition at line 206 of file misc.cpp.

◆ strFirstChar()

const char* strFirstChar ( const char *  target,
char  matchChar 
)

Definition at line 264 of file misc.cpp.

◆ strFirstWord()

const char* strFirstWord ( const char *  str)

Definition at line 438 of file misc.cpp.

◆ strGetBoolean()

bool strGetBoolean ( const char *  str)

Definition at line 500 of file misc.cpp.

◆ strGetFlag()

flagT strGetFlag ( const char *  str)

Definition at line 587 of file misc.cpp.

◆ strGetIntegers()

void strGetIntegers ( const char *  str,
int *  results,
uint  nResults 
)

Definition at line 539 of file misc.cpp.

◆ strGetResult()

resultT strGetResult ( const char *  str)

Definition at line 566 of file misc.cpp.

◆ strGetSquare()

squareT strGetSquare ( const char *  str)

Definition at line 614 of file misc.cpp.

◆ strGetUnsigneds()

void strGetUnsigneds ( const char *  str,
uint results,
uint  nResults 
)

Definition at line 553 of file misc.cpp.

◆ strIsSurnameOnly()

bool strIsSurnameOnly ( const char *  name)

Definition at line 477 of file misc.cpp.

◆ strIsUnknownName()

bool strIsUnknownName ( const char *  str)

Definition at line 465 of file misc.cpp.

◆ strLastChar()

const char* strLastChar ( const char *  target,
char  matchChar 
)

Definition at line 281 of file misc.cpp.

◆ strNextWord()

const char* strNextWord ( const char *  str)

Definition at line 451 of file misc.cpp.

◆ strPad()

uint strPad ( char *  target,
const char *  original,
int  width,
char  padding 
)

Definition at line 235 of file misc.cpp.

◆ strStrip()

void strStrip ( char *  str,
char  ch 
)

Definition at line 296 of file misc.cpp.

◆ strTrimDate()

void strTrimDate ( char *  str)

Definition at line 356 of file misc.cpp.

◆ strTrimLeft()

const char* strTrimLeft ( const char *  target,
const char *  trimChars 
)

Definition at line 314 of file misc.cpp.

◆ strTrimMarkCodes()

void strTrimMarkCodes ( char *  str)

Definition at line 371 of file misc.cpp.

◆ strTrimMarkup()

void strTrimMarkup ( char *  str)

Definition at line 415 of file misc.cpp.

◆ strTrimSuffix()

uint strTrimSuffix ( char *  target,
char  suffixChar 
)

Definition at line 332 of file misc.cpp.

◆ strUniqueExactMatch()

int strUniqueExactMatch ( const char *  keyStr,
const char **  strTable,
bool  exact 
)

Definition at line 639 of file misc.cpp.