KSquare Utilities
OSservices.h
Go to the documentation of this file.
1 /* OSservices.h -- O/S related functions, meant to be O/S neutral
2  * Copyright (C) 1994-2014 Kurt Kramer
3  * For conditions of distribution and use, see copyright notice in KKB.h
4  */
5 #ifndef _OSSERVICES_
6 #define _OSSERVICES_
7 
8 /**
9  *@file OSServices.h
10  *@author Kurt Kramer
11  *@brief General module for functions that interact with a specific operating system.
12  *@details The idea is that as long as you use the functions in this module we should
13  * be able to work in both Unix and Windows world.
14  */
15 
16 #include "DateTime.h"
17 #include "KKStr.h"
18 
19 namespace KKB
20 {
21  typedef long long osFilePos;
22 
23  /**
24  *@brief Will add the appropriate Directory separator character
25  * to the end of fileSpec if one is not there already.
26  */
27  void osAddLastSlash (KKStr& fileSpec);
28 
29  KKB::KKStr osAddSlash (const KKStr& fileSpec); // Returns fileSpec with a directory separating character at end.
30 
31  void osChangeDir (const KKStr& dirName,
32  bool& successful
33  );
34 
35  /**
36  *@brief Get a unique file name based off file spec 'fileName'.
37  *@details Make sure that fileName is unique, if file name already is used will add
38  * a sequence num to the root part of the name, starting with 0 and incrementing
39  * until file name is unique.
40  */
42 
43 
44  bool osCopyFile (const KKStr& srcFileName,
45  const KKStr& destFileName
46  );
47 
48  bool osCopyFileBetweenDirectories (const KKStr& _fileName,
49  const KKStr& _srcDir,
50  const KKStr& _destDir
51  );
52 
53  bool osCreateDirectory (const KKStr& dirName);
54 
55 
56  /**
57  *@brief Will create the whole Directory Path not just the final part of the path.
58  *@details For example if you need a directory path "C:\\Temp\\Temple\\DataFiles" created
59  * this function will create a directory in the specified path if they do not
60  * already exists.
61  */
62  bool osCreateDirectoryPath (KKStr _pathName);
63 
64  bool osDeleteFile (KKStr _fileName);
65 
66  void osDisplayWarning (KKStr _message);
67 
68  bool osFileExists (const KKStr& _fileName);
69 
70  FILE* osFOPEN (const char* fileName,
71  const char* mode
72  );
73 
74  /**
75  *@brief Calls the appropriate 64 bit function for operating system.
76  */
77  kkint64 osFTELL (FILE* f);
78 
79  int osFSEEK (FILE* f,
80  kkint64 offset,
81  int origin
82  );
83 
84  //***************************************************************************
85  //* These next set of functions are meant to extract different information *
86  //* from path strings that might be just a directory path or a complete *
87  //* file specification. *
88  //***************************************************************************
89 
91 
92  /**
93  *@brief Extracts the final sub-directory name of the fill directory specification.
94  *@code
95  ** ex:Input Returns
96  ** ----------------------- ----------------------
97  ** c:\an\Example\FileSpec\Romeo Romeo
98  ** /usr/kkramer/Kinsey/Release_2 Release_2
99  ** /usr/kkramer/Thesis/ Thesis
100  ** /usr/kkramer/Thesis.dat/ Thesis.dat
101  *@endcode
102  *@param[in] dirPath Directory path to get dir name from .
103  */
104  KKStr osGetDirNameFromPath (KKStr dirPath);
105 
106 
107  KKStr osGetErrorNoDesc (kkint32 errorNo);
108 
109 
110  /**
111  *@brief osGetFileNamePartOfFile, retrieves the file name part of the file spec.
112  *@details
113  *@code
114  * ex: Input (fullFileName) Returned
115  * --------------------------------_ ---------------
116  * c:\KurtUtilities\KKBase\KKStr.cpp KKStr.cpp
117  * /bin/usr/KKramer/Dictionary.dat Dictionary.dat
118  * dataFile.data dataFile.data
119  *@endcode
120  *@param[in] fullFileName Sting that contains the full file name specification.
121  *@return File Name.
122  */
123  KKStr osGetFileNamePartOfFile (KKStr fullFileName);
124 
125 
126  KKStr osGetFileExtension (KKStr fullFileName);
127 
128 
129  /** @brief returns the name and path of the current running application. */
131 
132 
133  /**
134  *@brief Returns the Parent directory path to 'dirPath'.
135  *@details
136  *@code
137  ** ex:Input Returns
138  ** ----------------------- ----------------------
139  ** c:\an\Example\FileSpec\Romeo c:\an\Example\FileSpec
140  ** /usr/kkramer/Kinsey/Release_2 /usr/kkramer/Kinsey
141  ** /usr/kkramer/Thesis/ /usr/kkramer
142  ** /usr/kkramer/Thesis.dat/ /usr/kkramer
143  *@endcode
144  */
145  KKStr osGetParentDirPath (KKStr dirPath);
146 
147 
148 
149  KKStr osGetHostName ();
150 
151  KKStr osGetUserName ();
152 
153  /**
154  *@brief Given a full drive with path and name return the drive letter specified.
155  *@details If not on a Windows system returns x'00'= char(0)
156  *@param[in] pathName File path to extract driver letter from.
157  *@return Drive Letter ('A' - 'Z').
158  */
159  char osGetDriveLetter (const KKStr& pathName);
160 
161  KKStrPtr osGetEnvVariable (const KKStr& _varName);
162 
163  KKB::DateTime osGetFileDateTime (const KKStr& fileName);
164 
165  kkint64 osGetFileSize (const KKStr& fileName);
166 
167  double osGetKernalTimeUsed ();
168 
169  /**
170  *@brief Returns a list of files that match the provided file specification.
171  *@details You can provide any file specification including a directory path. If there is a failure will return NULL.
172  * The caller will be responsible for deleting the returned list. The file names returned will not include
173  * any directory path.
174  */
175  KKStrListPtr osGetListOfFiles (const KKStr& fileSpec);
176 
177 
178  void osGetListOfFilesInDirectoryTree (const KKStr& rootDir,
179  KKStr fileSpec,
180  VectorKKStr& fileNames // The file names include full path.
181  );
182 
183  KKStrListPtr osGetListOfDirectories (KKStr fileSpec);
184 
185  KKStrListPtr osGetListOfImageFiles (KKStr fileSpec);
186 
187 
188  /**
189  *@brief Returns mili-secs that system (Windows = has been started, Linux time in epoch).
190  */
192 
193 
194  /**
195  *@brief Returned the current local date and time.
196  */
198 
200 
201 
202  /**
203  *@brief Get the path part of a full file name specification.
204  *@details
205  *@code
206  * ex:Input Returns
207  * ----------------------- ----------------------
208  * c:\an\Example\FileSpec\data.txt c:\an\Example\FileSpec
209  * /usr/kkramer/Plankton/Relase_2 /usr/kkramer/Plankton
210  * /usr/kkramer/Thesis/ /usr/kkramer/Thesis
211  *@endcode
212  *@param[in] fullFileName The full file specification including directory path, root-name, and extension.
213  *@return Path part of fullFileName.
214  */
215  KKStr osGetPathPartOfFile (KKStr fullFileName);
216 
218 
219  /** @brief returns the number of CPU's or number of simultaneous threads that you can have. */
221 
222  KKStr osGetProgName ();
223 
224  KKStr osGetRootName (const KKStr& fullFileName);
225 
226  KKStr osGetRootNameOfDirectory (KKStr fullDirName);
227 
228  KKStr osGetRootNameWithExtension (const KKStr& fullFileName);
229 
230  /**
231  *@brief Returns the number of CPU seconds used by current process.
232  *@details This consists of both User and Kernel Time.
233  * When used to get timing data of some function, Call this method before and after running the function and use the difference.
234  */
235  double osGetSystemTimeUsed ();
236 
238 
239  double osGetUserTimeUsed ();
240 
241  kkint32 osLocateFirstSlashChar (const KKStr& fileSpec);
242 
243  kkint32 osLocateLastSlashChar (const KKStr& fileSpec);
244 
245 
246  /**
247  *@brief Look for a specified file in a sub-directory structure.
248  *@param[in] fileName Name of file we are looking for.
249  *@param[in] srcDir Sub Directory tree we want to search.
250  *@return Full directory path to where first occurrence of fileName is located. If not found will return back an empty string.
251  */
252  KKStr osLookForFile (const KKStr& fileName,
253  const KKStr& srcDir
254  );
255 
256 
257  KKStr osMakeFullFileName (const KKStr& _dirName,
258  const KKStr& _fileName
259  );
260 
261 
262  bool osMoveFileBetweenDirectories (const KKStr& _fileName,
263  const KKStr& _srcDir,
264  const KKStr& _destDir
265  );
266 
267  void osParseFileName (KKStr _fileName,
268  KKStr& _dirPath,
269  KKStr& _rootName,
270  KKStr& _extension
271  );
272 
273 
274  void osParseFileSpec (KKStr fullFileName,
275  KKStr& driveLetter,
276  KKStr& path,
277  KKStr& root,
278  KKStr& extension
279  );
280 
281  KKStr osRemoveExtension (const KKStr& _fullFileName);
282 
283  void osSleep (float numOfSecs);
284 
285  void osSleepMiliSecs (kkuint32 numMiliSecs);
286 
288 
289 
290  /**
291  *@brief Substitute in the value of the environment variables into 'src'.
292  *@details Will scan the 'src' string for references to environment variables. The
293  * format would be $(env-var-name). These sub-strings in 'src' will be replaced by
294  * the the actual value of the environment variable. If no such environment variable
295  * exists the substring will be left as is besides parentheses '{}' or '[]' can be
296  * used, ex the string "${KinseyHomeDir}\\Reports" would be replaced by "c:\Kinsey\reports"
297  *@param[in] src String that you want to scan for environment variables.
298  *@return 'src' string with environment variables expanded.
299  */
301 
302 
303  /**
304  *@brief Read the next logical token from a file using characters in 'delimiters' to
305  * separate tokens.
306  *@details Use this function to read logical tokens from a file. It recognizes the
307  * concept of a line that is terminated by the line feed ('\n') character.
308  * When end of line is reached it will return an empty string setting 'eol'
309  * to true; the very next call will return the first token on the next
310  * line. The leading whitespace characters ' ' and '\\r' will be skipped
311  * before reading the next token. Tokens will be separated by any one of
312  * the characters specified in 'delimiters'. Two or more delimiters that
313  * occur consecutively will not be treated as one separator. You will need
314  * to call this method for each one.
315  *
316  * ex: the string "Apple\tPeer\t\tGrape\t\n" with the delimiters = "\t"
317  * will generate the following tokens when
318  * "Apple", "Peer", "", "Grape", "", ""(eol = True)
319  *@param[in] in File handle to read from.
320  *@param[in] delimiters c string listing delimiter characters.
321  *@param[out] eof End of file flag. When this goes true so will eol, also
322  * no token will be returned.
323  *@param[out] eol Will be set to true when the end-of-line is reached ('\\n').
324  * No token will be returned. The next call to this method
325  * will start at the next line.
326  *@return The next token read from the file. You must also monitor the 'eol' and
327  * 'eof' variables. If either one is true the no token will be returned.
328  */
329  KKB::KKStr osReadNextToken (FILE* in,
330  const char* delimiters,
331  bool& eof,
332  bool& eol
333  );
334 
335  /**
336  *@brief Read the next logical token from a file using characters in 'delimiters' to
337  * separate tokens where '\n'(end of line) is just another whitespace character.
338  *@details Use this function to read logical tokens from a file. Leading whitespace
339  * characters ' ', '\\n', and '\\r' will be skipped before reading the
340  * next token. Tokens will be separated by any one of the characters specified
341  * in 'delimiters'. Two or more delimiters that occur consecutively will not
342  * be treated as one separator. You will need to call this method for each one.
343  * Note that whitespace characters are not treated as delimiters but characters
344  * that are to be ignored before and after the token.
345  *
346  * ex: the string "Apple\tPeer\t\tGrape\t\n" with the delimiters = "\t"
347  * will generate the following tokens when
348  * "Apple", "Peer", "", "Grape", "", ""(eol = True)
349  *@param[in] in File handle to read from.
350  *@param[in] delimiters c string listing delimiter characters.
351  *@param[out] eof End of file flag. When this goes true so will eol, also
352  * no token will be returned.
353  *@return The next token read from the file. You must also monitor the 'eol' and
354  * 'eof' variables. If either one is true the no token will be returned.
355  */
356  KKStr osReadNextToken (FILE* in,
357  const char* delimiters,
358  bool& eof
359  );
360 
361  /**
362  *@brief Read the next logical token from a file using characters in 'delimiters' to
363  * separate tokens.
364  *@details Use this function to read logical tokens from a input stream. It
365  * recognizes the concept of a line that is terminated by the line feed
366  * ('\n') character. When end of line is reached it will return an empty
367  * string setting 'eol' to true; the very next call will return the first
368  * token on the next line. The leading whitespace characters ' ' and '\]r'
369  * will be skipped before reading the next token. Tokens will be separated
370  * by any one of the characters specified in 'delimiters'. Two or more
371  * delimiters that occur consecutively will not be treated as one separator.
372  * You will need to call this method for each one.
373  *
374  * ex: the string "Apple\tPeer\t\tGrape\t\n" with the delimiters = "\t"
375  * will generate the following tokens when
376  * "Apple", "Peer", "", "Grape", "", ""(eol = True)
377  *@param[in] in Input Stream to read from.
378  *@param[in] delimiters c string listing delimiter characters.
379  *@param[out] eof End of file flag. When this goes true so will eol, also
380  * no token will be returned.
381  *@param[out] eol Will be set to true when the end-of-line is reached ('\n').
382  * No token will be returned. The next call to this method
383  * will start at the next line.
384  *@return The next token read from the file. You must also monitor the 'eol' and
385  * 'eof' variables. If either one is true the no token will be returned.
386  */
387  KKB::KKStr osReadNextToken (std::istream& in,
388  const char* delimiters,
389  bool& eof,
390  bool& eol
391  );
392 
393  /**
394  *@brief Extracts text up to and including the next end-of-line character and returns pointer to dynamical allocated str that caller will own.
395  *@details The new-line character that terminated the nor any carriage-return will not be included. If stream [[in]] is already at
396  * end-of-file then will return NULL as well as eof being set to true.
397  *@param in Stream to read text from.
398  *@param eof Set to true if end-of-file is reached while reading file.
399  */
400  KKB::KKStrPtr osReadRestOfLine (std::istream& in,
401  bool& eof
402  );
403 
404  KKB::KKStr osReadRestOfLine2 (std::istream& in,
405  bool& eof
406  );
407 
408  KKB::KKStrPtr osReadRestOfLine (FILE* in,
409  bool& eof
410  );
411 
412  KKB::KKStr osReadRestOfLine2 (FILE* in,
413  bool& eof
414  );
415 
416  /**
417  *@brief Read the next line from the file and return a c-String(NULL terminated).
418  *@details Will read in characters from 'in' until a line feed character is
419  * read. The caller will own the string returned and be responsible
420  * for deleting it.
421  *@param[in] in File to read from.
422  *@return A dynamically allocated c-string (NULL Terminated) containing the next
423  * line in the file. If end-of-file reached will return a NULL pointer.
424  */
425  KKStrPtr osReadNextLine (FILE* in);
426 
427 
428 
429  /**
430  *@brief Read the next Quoted String from the file.
431  *@details If the first non whitespace character is a quote (") character will read
432  * in rest of string until the next occurrence of a Quote character. Otherwise
433  * it will read in characters until another whitespace character occurs.
434  *@param[in] in File to read from.
435  *@param[in] whiteSpaceCharacters c-string (NULL Terminated) list of white space characters.
436  *@param[out] eof Will be set to true if we are at the end of file when you make the call.
437  *@return A String containing the next String in the file.
438  */
439  KKB::KKStr osReadNextQuotedStr (FILE* in,
440  const char* whiteSpaceCharacters,
441  bool& eof
442  );
443 
444  /**
445  *@brief Skips rest of the characters in the current line in the file.
446  *@details Will skip all characters in 'in' until a '\n' is read or the end of file
447  * has been reached. It is meant be be used in conjunction with
448  * 'osReadNextToken'.
449  *@param[in] in File being read.
450  *@param[out] eof Will be set to true if end of file is encountered.
451  */
452  void osSkipRestOfLine (FILE* in,
453  bool& eof
454  );
455 
456  /**
457  *@brief Skips rest of the characters in the current line in the input stream.
458  *@details Will skip all characters in 'in' until a '\n' is read or the end of file
459  * has been reached. It is meant be be used in conjunction with
460  * 'osReadNextToken'.
461  *@param[in] in File being read.
462  *@param[out] eof Will be set to true if end of file is encountered.
463  */
464  void osSkipRestOfLine (std::istream& in,
465  bool& eof
466  );
467 
468  bool osRenameFile (const KKStr& oldName,
469  const KKStr& newName
470  );
471 
472  bool osValidDirectory (KKStrConstPtr _name);
473 
474  bool osValidDirectory (const KKStr& _name);
475 
476  bool osValidFileName (const KKStr& _name);
477 
478  /** @brief Returns list of errors in '_name' with respect to it being a valid file name for the O/S. */
479  KKStrListPtr osValidFileNameErrors (const KKStr& _name);
480 
481  bool osIsBackGroundProcess ();
482 
484 
485  void osWaitForEnter ();
486 
487 
488  template<class T>
489  inline T* osGrowAllocation (T* src,
490  kkint32 origSize,
491  kkint32 newSize
492  )
493  {
494  kkint32 zed = 0;
495  T* dest = new T[newSize];
496  while (zed < origSize) {dest[zed] = src[zed]; zed++;}
497  while (zed < newSize) {dest[zed] = (T)0; zed++;}
498  delete src;
499  return dest;
500  } /* GrowAllocation */
501 
502 
503 
504  #ifdef WIN32
505  #define DS "\\"
506  #define DSchar '\\'
507  #else
508  #define DS "/"
509  #define DSchar '/'
510  #endif
511 
512 } /* namespace KKB */
513 
514 #endif
KKStr osGetFullPathOfApplication()
returns the name and path of the current running application.
char osGetDriveLetter(const KKStr &pathName)
Given a full drive with path and name return the drive letter specified.
Definition: OSservices.cpp:297
kkuint64 osGetSystemTimeInMiliSecs()
Returns mili-secs that system (Windows = has been started, Linux time in epoch).
bool osDeleteFile(KKStr _fileName)
Definition: OSservices.cpp:523
bool osValidFileName(const KKStr &_name)
Definition: OSservices.cpp:443
KKB::KKStr osReadNextToken(FILE *in, const char *delimiters, bool &eof, bool &eol)
Read the next logical token from a file using characters in &#39;delimiters&#39; to separate tokens...
long long osFilePos
Definition: OSservices.h:21
KKB::KKStr osReadNextQuotedStr(FILE *in, const char *whiteSpaceCharacters, bool &eof)
Read the next Quoted String from the file.
KKStr osRemoveExtension(const KKStr &_fullFileName)
__int32 kkint32
Definition: KKBaseTypes.h:88
KKB::DateTime osGetLocalDateTime()
Returned the current local date and time.
KKB::KKStrPtr osReadRestOfLine(std::istream &in, bool &eof)
Extracts text up to and including the next end-of-line character and returns pointer to dynamical all...
bool osValidDirectory(const KKStr &_name)
Definition: OSservices.cpp:398
kkint32 osGetNumberOfProcessors()
returns the number of CPU&#39;s or number of simultaneous threads that you can have.
KKStr osGetParentDirPath(KKStr dirPath)
Returns the Parent directory path to &#39;dirPath&#39;.
KKStr osGetPathPartOfFile(KKStr fullFileName)
Get the path part of a full file name specification.
kkint64 osFTELL(FILE *f)
Calls the appropriate 64 bit function for operating system.
Definition: OSservices.cpp:93
KKStr osCreateUniqueFileName(KKStr fileName)
Get a unique file name based off file spec &#39;fileName&#39;.
KKStr osMakeFullFileName(const KKStr &_dirName, const KKStr &_fileName)
KKStrPtr osReadNextLine(FILE *in)
Read the next line from the file and return a c-String(NULL terminated).
void osWaitForEnter()
KKB::KKStr osReadNextToken(std::istream &in, const char *delimiters, bool &eof, bool &eol)
Read the next logical token from a file using characters in &#39;delimiters&#39; to separate tokens...
void osGetListOfFilesInDirectoryTree(const KKStr &rootDir, KKStr fileSpec, VectorKKStr &fileNames)
void osSkipRestOfLine(std::istream &in, bool &eof)
Skips rest of the characters in the current line in the input stream.
kkint32 osGetThreadId()
KKStrListPtr osGetListOfImageFiles(KKStr fileSpec)
KKStrListPtr osGetListOfFiles(const KKStr &fileSpec)
Returns a list of files that match the provided file specification.
double osGetKernalTimeUsed()
kkint32 osLocateLastSlashChar(const KKStr &fileSpec)
unsigned __int32 kkuint32
Definition: KKBaseTypes.h:89
KKStr osReadNextToken(FILE *in, const char *delimiters, bool &eof)
Read the next logical token from a file using characters in &#39;delimiters&#39; to separate tokens where &#39; &#39;...
void osSleep(float numOfSecs)
KKStr osGetFileExtension(KKStr fullFileName)
bool osCopyFileBetweenDirectories(const KKStr &_fileName, const KKStr &_srcDir, const KKStr &_destDir)
Definition: OSservices.cpp:643
__int64 kkint64
Definition: KKBaseTypes.h:90
double osGetUserTimeUsed()
KKStrListPtr osValidFileNameErrors(const KKStr &_name)
Returns list of errors in &#39;_name&#39; with respect to it being a valid file name for the O/S...
Definition: OSservices.cpp:458
KKB::KKStr osAddSlash(const KKStr &fileSpec)
KKB::KKStr osReadRestOfLine2(FILE *in, bool &eof)
KKTHread * KKTHreadPtr
void osParseFileName(KKStr _fileName, KKStr &_dirPath, KKStr &_rootName, KKStr &_extension)
KKStr osLookForFile(const KKStr &fileName, const KKStr &srcDir)
Look for a specified file in a sub-directory structure.
void osParseFileSpec(KKStr fullFileName, KKStr &driveLetter, KKStr &path, KKStr &root, KKStr &extension)
kkint32 osGetProcessId()
void osChangeDir(const KKStr &dirName, bool &successful)
Definition: OSservices.cpp:793
KKStr osGetHostName()
kkint32 osLocateFirstSlashChar(const KKStr &fileSpec)
VectorKKStr osSplitDirectoryPathIntoParts(const KKStr &path)
bool osValidDirectory(KKStrConstPtr _name)
Definition: OSservices.cpp:382
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of &#39;std::string&#39; strings.
Definition: KKStr.cpp:1082
KKB::KKStr osReadRestOfLine2(std::istream &in, bool &eof)
void osSleepMiliSecs(kkuint32 numMiliSecs)
KKStr osGetRootNameOfDirectory(KKStr fullDirName)
unsigned __int64 kkuint64
Definition: KKBaseTypes.h:91
int osFSEEK(FILE *f, kkint64 offset, int origin)
Definition: OSservices.cpp:104
KKStrPtr osGetEnvVariable(const KKStr &_varName)
Definition: OSservices.cpp:897
T * osGrowAllocation(T *src, kkint32 origSize, kkint32 newSize)
Definition: OSservices.h:489
bool osCreateDirectory(const KKStr &dirName)
Definition: OSservices.cpp:875
KKB::KKStr osSubstituteInEnvironmentVariables(const KKStr &src)
Substitute in the value of the environment variables into &#39;src&#39;.
Definition: OSservices.cpp:977
double osGetSystemTimeUsed()
Returns the number of CPU seconds used by current process.
KKStr osGetUserName()
bool osFileExists(const KKStr &_fileName)
Definition: OSservices.cpp:568
KKStrListPtr osGetListOfDirectories(KKStr fileSpec)
FILE * osFOPEN(const char *fileName, const char *mode)
Definition: OSservices.cpp:74
KKStr osGetParentDirectoryOfDirPath(KKStr path)
KKStr osGetFileNamePartOfFile(KKStr fullFileName)
osGetFileNamePartOfFile, retrieves the file name part of the file spec.
bool osCopyFile(const KKStr &srcFileName, const KKStr &destFileName)
Definition: OSservices.cpp:689
bool osIsBackGroundProcess()
bool osMoveFileBetweenDirectories(const KKStr &_fileName, const KKStr &_srcDir, const KKStr &_destDir)
Definition: OSservices.cpp:609
KKB::DateTime osGetFileDateTime(const KKStr &fileName)
KKStr osGetProgName()
KKStr osGetCurrentDirectory()
Definition: OSservices.cpp:319
KKStr osGetRootNameWithExtension(const KKStr &fullFileName)
void osSkipRestOfLine(FILE *in, bool &eof)
Skips rest of the characters in the current line in the file.
bool osCreateDirectoryPath(KKStr _pathName)
Will create the whole Directory Path not just the final part of the path.
Definition: OSservices.cpp:825
KKStr osGetDirNameFromPath(KKStr dirPath)
Extracts the final sub-directory name of the fill directory specification.
bool osRenameFile(const KKStr &oldName, const KKStr &newName)
Definition: OSservices.cpp:743
kkint64 osGetFileSize(const KKStr &fileName)
KKStr osGetErrorNoDesc(kkint32 errorNo)
Definition: OSservices.cpp:45
KKB::KKStrPtr osReadRestOfLine(FILE *in, bool &eof)
KKStr osGetRootName(const KKStr &fullFileName)
void osDisplayWarning(KKStr _message)
void osAddLastSlash(KKStr &fileSpec)
Will add the appropriate Directory separator character to the end of fileSpec if one is not there alr...
void osRunAsABackGroundProcess()