13 bool keep_root_slash = path.size() > 0 && path[ 0 ] ==
'/';
15 std::optional< size_t > dots = 0;
19 if( path[ from ] ==
'.' )
21 if( dots.has_value() )
22 dots = dots.value() + 1;
24 else if( path[ from ] ==
'/' || from == path.size() )
26 if( dots.has_value() )
28 if( dots.value() == 0 )
30 if( !keep_root_slash || to > 0 )
33 else if( dots.value() == 1 )
37 else if( dots.value() == 2 )
45 if( ( newto == -1 && path[ 0 ] !=
'/' ) || path[ newto ] ==
'/' )
72 if( from == path.size() )
74 if( path.size() && path[ 0 ] ==
'/' )
75 to = std::max( to, 1 );
77 path.resize( std::max( to, 0 ) );
83 path[ to ] = path[ from ];
96 path( std::string(
"/" ) + path )
102 path( std::string(
"/" ) + path )
108 this->path = std::string(
"/" ) + path;
114 this->path = std::string(
"/" ) + path;
125 this->path += append;
155 std::string result = vroot;
157 if( result.size() == 0 )
160 result = result +
"/" + this->path;
165 #if IV_CONFIG_FS_ENABLED
166 fs::path absolute = fs::absolute( fs::path( result ) );
167 return absolute.string();
177 return this->path == other.path;
184 return this->path != other.path;
191 return this->path < other.path;
196 return (*
this) /
".." / relative;
201 if( this->path.size() == 0 )
204 if( this->path[ this->path.size() - 1 ] ==
'/' )
207 return (*
this) /
"..";