Scid  4.6.5
Classes | Functions | Variables
misc.cpp File Reference
#include "common.h"
#include "misc.h"
#include "sqmove.h"
#include <stdio.h>
#include <ctype.h>
#include <sys/stat.h>
#include <cmath>
Include dependency graph for misc.cpp:

Go to the source code of this file.

Classes

struct  sqDir_Init
 

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 : the eco value to convert (must be != 0) 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)
 
void strTrimSurname (char *str, uint initials)
 
const char * strFirstWord (const char *str)
 
const char * strNextWord (const char *str)
 
bool strIsAllWhitespace (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)
 
uint fileSize (const char *name, const char *suffix)
 
uint rawFileSize (const char *name)
 
uint gzipFileSize (const char *name)
 

Variables

directionT sqDir [66][66]
 
struct sqDir_Init sqDir_Init_singleton
 

Function Documentation

ecoT eco_BasicCode ( ecoT  eco)

Definition at line 143 of file misc.cpp.

ecoT eco_FromString ( const char *  ecoStr)

Definition at line 69 of file misc.cpp.

ecoT eco_LastSubCode ( ecoT  eco)

Definition at line 176 of file misc.cpp.

ecoT eco_Reduce ( ecoT  eco)

ecoReduce() - maps eco to a smaller set : the 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 163 of file misc.cpp.

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

Definition at line 111 of file misc.cpp.

uint fileSize ( const char *  name,
const char *  suffix 
)

Definition at line 764 of file misc.cpp.

uint gzipFileSize ( const char *  name)

Definition at line 796 of file misc.cpp.

uint rawFileSize ( const char *  name)

Definition at line 781 of file misc.cpp.

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

Definition at line 222 of file misc.cpp.

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

Definition at line 196 of file misc.cpp.

char* strDuplicate ( const char *  original)

Definition at line 239 of file misc.cpp.

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

Definition at line 297 of file misc.cpp.

const char* strFirstWord ( const char *  str)

Definition at line 503 of file misc.cpp.

bool strGetBoolean ( const char *  str)

Definition at line 579 of file misc.cpp.

flagT strGetFlag ( const char *  str)

Definition at line 666 of file misc.cpp.

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

Definition at line 618 of file misc.cpp.

resultT strGetResult ( const char *  str)

Definition at line 645 of file misc.cpp.

squareT strGetSquare ( const char *  str)

Definition at line 693 of file misc.cpp.

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

Definition at line 632 of file misc.cpp.

bool strIsAllWhitespace ( const char *  str)

Definition at line 528 of file misc.cpp.

bool strIsSurnameOnly ( const char *  name)

Definition at line 556 of file misc.cpp.

bool strIsUnknownName ( const char *  str)

Definition at line 544 of file misc.cpp.

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

Definition at line 314 of file misc.cpp.

const char* strNextWord ( const char *  str)

Definition at line 516 of file misc.cpp.

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

Definition at line 268 of file misc.cpp.

void strStrip ( char *  str,
char  ch 
)

Definition at line 329 of file misc.cpp.

void strTrimDate ( char *  str)

Definition at line 389 of file misc.cpp.

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

Definition at line 347 of file misc.cpp.

void strTrimMarkCodes ( char *  str)

Definition at line 404 of file misc.cpp.

void strTrimMarkup ( char *  str)

Definition at line 448 of file misc.cpp.

uint strTrimSuffix ( char *  target,
char  suffixChar 
)

Definition at line 365 of file misc.cpp.

void strTrimSurname ( char *  str,
uint  initials 
)

Definition at line 472 of file misc.cpp.

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

Definition at line 718 of file misc.cpp.

Variable Documentation

directionT sqDir[66][66]

Definition at line 24 of file misc.cpp.

struct sqDir_Init sqDir_Init_singleton