Changeset 201 for cpp


Ignore:
Timestamp:
03/31/14 23:22:29 (10 years ago)
Author:
Maciej Komosinski
Message:

Moved isAbsolutePath() to another source file and added implementation for Windows

Location:
cpp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/nonstd_stdio.cpp

    r197 r201  
    44
    55#include "nonstd_stdio.h"
     6#include "nonstd.h"
     7
    68#if defined _WIN32 && !defined SHP
    7 //tu nie trzeba includów zeby dzialal unlink()
     9 //<unistd.h> not needed for unlink()
     10 #include "Shlwapi.h" //PathIsRelative()
     11 #include "Util.h" //strTOwstr()
    812#else
    9 #include <unistd.h>
    10 #endif
    11 #include "nonstd.h"
     13 #include <unistd.h>
     14#endif
    1215
    1316bool fileExists(const char* path)
     
    2528}
    2629
     30bool isAbsolutePath(const char* fname)
     31{
     32        if (fname == NULL) return false; //SplitFileSystem never passes NULL but this function is public so we never know
     33#if defined _WIN32 && !defined SHP
     34        return PathIsRelative(Util::strTOwstr(fname).c_str()) == TRUE; //http://msdn.microsoft.com/en-us/library/bb773660%28v=vs.85%29.aspx
     35#else
     36        return fname[0] == PATH_SEPARATOR_CHAR;
     37#endif
     38}
    2739
    2840#if defined SHP && defined BADA_API_1
  • cpp/common/nonstd_stdio.h

    r197 r201  
    88bool fileExists(const char* path);
    99bool removeFile(const char* path);
     10bool isAbsolutePath(const char* fname);
    1011
    1112#ifdef _WIN32
  • cpp/frams/genetics/oper_fx.h

    r199 r201  
    8383   char supported_format; ///<genotype format which is supported by this class ('6' for GenoOper_f6, 'F' for GenoOper_fF, etc.). Must be initialized in constructor
    8484   string name; ///<name of this set of genetic operators
    85    const char **mutation_method_names; ///<array of names for mutation methods. If initialized (by new char*[]), must have entries for each method index returned by mutate(geno,chg,METHOD).  If initialized, it is automatically freed by this destructor.
     85   const char **mutation_method_names; ///<array of names for mutation methods. If initialized (by new const char*[]), must have entries for each method index returned by mutate(geno,chg,METHOD).  If initialized, it is automatically freed by this destructor.
    8686   GenoOperators() : par(empty_paramtab) {supported_format='x'; name="Default"; mutation_method_names=NULL; setDefaults();}
    8787
Note: See TracChangeset for help on using the changeset viewer.