GUI/node_modules/slice2js/ice/cpp/src/IceUtil/FileUtil.cpp
bool
IceUtilInternal::isAbsolutePath(const string& path)
{
    size_t i = 0;
    size_t size = path.size();

    // Skip whitespace
    while(i < size && isspace(static_cast<unsigned char>(path[i])))
    {
        ++i;
    }

#ifdef _WIN32
    // We need at least 3 non whitespace character to have
    // and absolute path
    if(i + 3 > size)
    {
        return false;
    }

    // Check for X:\ path ('\' may have been converted to '/')
    if((path[i] >= 'A' && path[i] <= 'Z') || (path[i] >= 'a' && path[i] <= 'z'))
    {
        return path[i + 1] == ':' && (path[i + 2] == '\\' || path[i + 2] == '/');
    }

    // Check for UNC path
    return (path[i] == '\\' && path[i + 1] == '\\') || path[i] == '/';
#else
    if(i >= size)
    {
        return false;
    }

    return path[i] == '/';
#endif
}
//
// Determine if path is an absolute path
//
Determine if path is an absolute path
Determine if path is an absolute path
bool
IceUtilInternal::isAbsolutePath(const string& path)
{
    size_t i = 0;
    size_t size = path.size();
    while(i < size && isspace(static_cast<unsigned char>(path[i])))
    {
        ++i;
    }
#ifdef _WIN32
    if(i + 3 > size)
    {
        return false;
    }
    if((path[i] >= 'A' && path[i] <= 'Z') || (path[i] >= 'a' && path[i] <= 'z'))
    {
        return path[i + 1] == ':' && (path[i + 2] == '\\' || path[i + 2] == '/');
    }
    return (path[i] == '\\' && path[i + 1] == '\\') || path[i] == '/';
#else
    if(i >= size)
    {
        return false;
    }
    return path[i] == '/';
#endif
}
bool IceUtilInternal :: isAbsolutePath ( const string & path ) { size_t i = 0 ; size_t size = path . size ( ) ; while ( i < size && isspace ( static_cast < unsigned char > ( path [ i ] ) ) ) { ++ i ; } #ifdef _WIN32 if ( i + 3 > size ) { return false ; } if ( ( path [ i ] >= ' ' && path [ i ] <= ' ' ) || ( path [ i ] >= ' ' && path [ i ] <= ' ' ) ) { return path [ i + 1 ] == ' ' && ( path [ i + 2 ] == ' \\ ' || path [ i + 2 ] == ' ' ) ; } return ( path [ i ] == ' \\ ' && path [ i + 1 ] == ' \\ ' ) || path [ i ] == ' ' ; #else if ( i >= size ) { return false ; } return path [ i ] == ' ' ; #endif }
Determine if path is an absolute path
Determine if path is an absolute path
// Skip whitespace // We need at least 3 non whitespace character to have // and absolute path // Check for X:\ path ('\' may have been converted to '/') // Check for UNC path