CONFIG LIB 1.5
Configuration Files Library (by TGG 2020)
|
Simple I/O functions class. More...
#include <iofun.h>
Static Public Member Functions | |
static void | Win2Unix (char *s) |
conversion of directory separators - MS Windows to Unix | |
static void | Unix2Win (char *s) |
conversion of directory separators - Unix to MS Windows | |
static int | ReadComm (FILE *stream) |
Function to read of a comment till the end of line. It returns 0 or EOF if it is performed. | |
static void | ReadDummy (FILE *stream) |
Function to read a comment line. | |
static int | ReadPar (FILE *stream, const char *Format, void *Par) |
Function to read one variable. The type of variable depends on Format, compatible with stdio library. | |
static int | ReadPar (FILE *stream, const char *Format, void *Par1, void *Par2) |
Function to read two variables. The type of variables depends on Format, compatible with stdio library. | |
static int | ReadPar (FILE *stream, const char *Format, void *Par1, void *Par2, void *Par3) |
Function to read three variables. The type of variables depends on Format, compatible with stdio library. | |
static int | ReadPar (FILE *stream, const char *Format, void *Par1, void *Par2, void *Par3, void *Par4) |
Function to read four variables. The type of variables depends on Format, compatible with stdio library. | |
static int | ReadVect3 (FILE *stream, double *Par, double dScal=1.) |
Function to read double vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "dScal". | |
static int | ReadVect3 (FILE *stream, float *Par, float fScal=1.) |
Function to read float vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "fScal". | |
static int | ReadVect3 (FILE *stream, long *Par, long lScal=1) |
Function to read long vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "lScal". | |
static int | ReadVect3 (FILE *stream, int *Par, int iScal=1) |
Function to read int vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "iScal". | |
static int | ReadVect (FILE *stream, double *Par, int n, double dScal=1.) |
Function to read double vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "dScal". | |
static int | ReadVect (FILE *stream, float *Par, int n, float fScal=1.) |
Function to read float vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "fScal". | |
static int | ReadVect (FILE *stream, long *Par, int n, long lScal=1) |
Function to read long vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "lScal". | |
static int | ReadVect (FILE *stream, int *Par, int n, int iScal=1) |
Function to read int vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "iScal". | |
static int | ReadStr (FILE *stream, char *Par) |
Function to read the new line from FILE "stream" and to store it in table of char "Par". The starting and ending blanc charaters are clipped. | |
static void | ReadStrL (FILE *stream, char *Par, int *len) |
Function to read the string (Par) from FILE "stream". It reads from current pointer of FILE to the end of line or EOF. Number of read characters is returned in "len". | |
static void | ClipString (char *string) |
Clipping of the "string" up to the first blanc character or comment "#" character. | |
static void | ClipFileName (char *string) |
Clipping of the ending blanc characters of "string". | |
static bool | CompareStrings (char *str1, char *str2) |
Compares two strings (str1 and str2). Returns true if they match, false otherwise. | |
static int | file_exist (const char *name) |
Returns true (1) if file "name" does exist, 0 otherwise. | |
static const char * | filename_name (const char *name) |
Returns pointer to filename without path. | |
static const char * | filename_ext (const char *buf) |
Returns pointer to filename extension. | |
static char * | filename_setext (char *buf, int buflen, const char *ext) |
set/change filename extension | |
static int | filename_dir (char *name) |
returns the length of the path in (path)name | |
static const char * | filename_date (const char *name) |
Returns pointer to the string that contains the date of last file modification/creation. | |
static FILE * | fopen (const char *filename, const char *mode) |
Cross-platform function to fopen function that supports UTF-8 encoded name. | |
static int | stat (const char *f, struct stat *b) |
Cross-platform function to stat() a file using a UTF-8 encoded name or value. | |
static size_t | strlcpy (char *d, const char *s, size_t bufsize) |
The implementation of nonstandard strlcpy function. | |
static int | nLines (FILE *stream) |
Returns number of lines of text file from current pointer to EOF. | |
static int | nColumns (FILE *stream, char Par[][32]) |
Returns number of columns of text file (number of strings in the first line). Names of columns are stored in Par array. | |
static int | isstrblank (char *cc, int iLen) |
Checks if string (cc) is blank (1/0) | |
static void | ReadVect3 (FILE *stream, VECTOR_3D *Vec, double dScal=1.) |
Function to read VECTOR_3D Vec components from FILE "stream". The read values are scaled by multiplier "dScal". | |
static int | readln (FILE *ff, char *value_x) |
Pascal style "readln" function to read string. | |
static int | readln (FILE *ff, int *value_x) |
Pascal style "readln" function to read int. | |
static int | readln (FILE *ff, long *value_x) |
Pascal style "readln" function to read long. | |
static int | readln (FILE *ff, float *value_x) |
Pascal style "readln" function to read float. | |
static int | readln (FILE *ff, double *value_x) |
Pascal style "readln" function to read double. | |
static int | readln (FILE *ff, long double *value_x) |
Pascal style "readln" function to read long double. | |
static int | readln (FILE *ff) |
Pascal style "readln" function to read comment. | |
static int | readln (FILE *ff, VECTOR_3D *vec) |
Pascal style "readln" function to read VECTOR_3D components. | |
static int | read (FILE *ff, char *value_x) |
Pascal style "read" function to read string. | |
static int | read (FILE *ff, int *value_x) |
Pascal style "read" function to read int. | |
static int | read (FILE *ff, long *value_x) |
Pascal style "read" function to read long. | |
static int | read (FILE *ff, float *value_x) |
Pascal style "read" function to read float. | |
static int | read (FILE *ff, double *value_x) |
Pascal style "read" function to read double. | |
static int | read (FILE *ff, long double *value_x) |
Pascal style "read" function to read long double. | |
static int | read (FILE *ff, VECTOR_3D *vec) |
Pascal style "read" function to read VECTOR_3D components. | |
|
static |
Clipping of the ending blanc characters of "string".
Definition at line 250 of file iofun.cpp.
Referenced by SDSA_PARAMS::Read(), PANUKL_PLR::Read(), PANUKL_PRJ::Read(), PANUKL_AUTO::Read(), CON_FILE::ReadCON(), NGH_FILE::ReadNGH(), PAR_FILE::ReadPAR(), and PRS_FILE::ReadPRS().
|
static |
|
static |
Compares two strings (str1 and str2). Returns true if they match, false otherwise.
Definition at line 270 of file iofun.cpp.
Referenced by MS2_Data::Read(), CONNECT_DATA::Read(), MS2_Data::ReadChordDivision(), MS2_Data::ReadFusAirfoil(), MS2_Data::ReadFusFromParams(), MS2_Data::ReadProfile(), MS2_Data::ReadWing(), and MS2_Data::ReadWingModule().
|
static |
Returns true (1) if file "name" does exist, 0 otherwise.
Definition at line 327 of file iofun.cpp.
|
static |
Returns pointer to the string that contains the date of last file modification/creation.
Definition at line 399 of file iofun.cpp.
Referenced by GRID_ARRAYS::ReadDAT(), GRID_ARRAYS::ReadDATw(), GRID_ARRAYS::ReadINP(), and GRID_ARRAYS::ReadWyn().
|
static |
returns the length of the path in (path)name
|
static |
Returns pointer to filename extension.
Definition at line 302 of file iofun.cpp.
Referenced by filename_setext(), and MS2_Data::RemoveExt().
|
static |
Returns pointer to filename without path.
Definition at line 284 of file iofun.cpp.
Referenced by PRS_FILE::DefNames(), MS2_Data::ReadFusAirfoil(), MS2_Data::ReadProfile(), MS2_Data::ReadSection(), MS2_Data::ReadWing(), and MS2_Data::ReadWingModule().
|
static |
set/change filename extension
Definition at line 317 of file iofun.cpp.
Referenced by PRS_FILE::DefFile().
|
static |
Cross-platform function to fopen function that supports UTF-8 encoded name.
Definition at line 358 of file iofun.cpp.
Referenced by file_exist(), SDSA_PARAMS::Read(), PANUKL_PLR::Read(), PANUKL_PRJ::Read(), PANUKL_AUTO::Read(), MS2_Data::Read(), SDSA_FILE::Read(), TXT_OUT_FILE::Read(), CON_FILE::ReadCON(), GRID_ARRAYS::ReadDAT(), GRID_ARRAYS::ReadDATw(), GRID_ARRAYS::ReadINP(), NGH_FILE::ReadNGH(), PAR_FILE::ReadPAR(), PRS_FILE::ReadPRS(), GRID_ARRAYS::ReadWyn(), SDSA_PARAMS::Write(), PANUKL_PLR::Write(), PANUKL_PRJ::Write(), PANUKL_AUTO::Write(), SDSA_FILE::Write(), TXT_OUT_FILE::Write(), CON_FILE::WriteCON(), GRID_ARRAYS::WriteDAT(), GRID_ARRAYS::WriteInpFromPanels(), GRID_ARRAYS::WriteInpFromPoints(), NGH_FILE::WriteNGH(), PAR_FILE::WritePAR(), PRS_FILE::WritePRS(), and GRID_ARRAYS::WriteWyn().
|
static |
Checks if string (cc) is blank (1/0)
Definition at line 476 of file iofun.cpp.
Referenced by nLines().
|
static |
Returns number of columns of text file (number of strings in the first line). Names of columns are stored in Par array.
Definition at line 447 of file iofun.cpp.
Referenced by TXT_OUT_FILE::Read().
|
static |
Returns number of lines of text file from current pointer to EOF.
Definition at line 426 of file iofun.cpp.
Referenced by TXT_OUT_FILE::Read().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Function to read of a comment till the end of line. It returns 0 or EOF if it is performed.
Definition at line 42 of file iofun.cpp.
Referenced by MS2_Data::find_section(), MS2_Data::has_section(), PANUKL_PLR::Read(), PANUKL_PRJ::Read(), MS2_Data::Read(), ReadDummy(), readln(), readln(), PAR_FILE::ReadPAR(), ReadPar(), ReadPar(), ReadPar(), ReadPar(), PRS_FILE::ReadPRS(), ReadVect(), ReadVect(), ReadVect(), ReadVect(), MS2_Data::ReadWing(), and GRID_ARRAYS::ReadWyn().
|
static |
Function to read a comment line.
Definition at line 50 of file iofun.cpp.
Referenced by MS2_Data::Read(), MS2_Data::ReadChordDivision(), ReadPar(), ReadPar(), ReadPar(), ReadPar(), ReadStr(), ReadVect(), ReadVect(), ReadVect(), ReadVect(), and MS2_Data::ReadWingModule().
|
static |
|
static |
|
static |
Pascal style "readln" function to read double.
Definition at line 535 of file iofun.cpp.
|
static |
|
static |
|
static |
|
static |
|
static |
Pascal style "readln" function to read VECTOR_3D components.
Definition at line 553 of file iofun.cpp.
|
static |
Function to read one variable. The type of variable depends on Format, compatible with stdio library.
Definition at line 67 of file iofun.cpp.
Referenced by MS2_Data::find_section(), SDSA_PARAMS::Read(), PANUKL_PLR::Read(), PANUKL_PRJ::Read(), PANUKL_AUTO::Read(), MS2_Data::Read(), SDSA_FILE::Read(), CONNECT_DATA::Read(), MS2_Data::ReadChordDivision(), CON_FILE::ReadCON(), GRID_ARRAYS::ReadDAT(), GRID_ARRAYS::ReadDATw(), MS2_Data::ReadFusFromParams(), GRID_ARRAYS::ReadINP(), readln(), readln(), readln(), readln(), readln(), NGH_FILE::ReadNGH(), PAR_FILE::ReadPAR(), MS2_Data::ReadProfile(), PRS_FILE::ReadPRS(), MS2_Data::ReadSection(), MS2_Data::ReadWing(), and GRID_ARRAYS::ReadWyn().
|
static |
|
static |
|
static |
|
static |
Function to read the new line from FILE "stream" and to store it in table of char "Par". The starting and ending blanc charaters are clipped.
Definition at line 163 of file iofun.cpp.
Referenced by SDSA_PARAMS::Read(), PANUKL_PLR::Read(), PANUKL_PRJ::Read(), PANUKL_AUTO::Read(), MS2_Data::Read(), CONNECT_DATA::Read(), CON_FILE::ReadCON(), GRID_ARRAYS::ReadDAT(), GRID_ARRAYS::ReadDATw(), MS2_Data::ReadFusAirfoil(), MS2_Data::ReadFusFromParams(), GRID_ARRAYS::ReadINP(), NGH_FILE::ReadNGH(), PAR_FILE::ReadPAR(), MS2_Data::ReadProfile(), MS2_Data::ReadProfile(), PRS_FILE::ReadPRS(), MS2_Data::ReadSection(), MS2_Data::ReadWing(), MS2_Data::ReadWingModule(), and GRID_ARRAYS::ReadWyn().
|
static |
Function to read the string (Par) from FILE "stream". It reads from current pointer of FILE to the end of line or EOF. Number of read characters is returned in "len".
Definition at line 216 of file iofun.cpp.
Referenced by nLines().
|
static |
Function to read double vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "dScal".
Definition at line 99 of file iofun.cpp.
Referenced by CON_FILE::ReadCON(), MS2_Data::ReadFusEllipse(), MS2_Data::ReadFusFromParams(), ReadVect3(), ReadVect3(), ReadVect3(), and ReadVect3().
|
static |
Function to read float vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "fScal".
|
static |
Function to read int vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "iScal".
|
static |
Function to read long vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "lScal".
|
static |
Function to read double vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "dScal".
Definition at line 143 of file iofun.cpp.
Referenced by readln(), and ReadVect3().
|
static |
|
static |
|
static |
|
static |
Function to read VECTOR_3D Vec components from FILE "stream". The read values are scaled by multiplier "dScal".
Definition at line 496 of file iofun.cpp.
|
static |
Cross-platform function to stat() a file using a UTF-8 encoded name or value.
Definition at line 382 of file iofun.cpp.
Referenced by filename_date().
|
static |
The implementation of nonstandard strlcpy function.
Definition at line 415 of file iofun.cpp.
Referenced by filename_setext().
|
static |
conversion of directory separators - Unix to MS Windows
Definition at line 33 of file iofun.cpp.
Referenced by ClipFileName(), and filename_dir().
|
static |
conversion of directory separators - MS Windows to Unix
Definition at line 25 of file iofun.cpp.
Referenced by ClipFileName(), and filename_dir().