Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032 #pragma once
00033
00034 #include "../api_core.h"
00035 #include <vector>
00036
00040 class CL_API_CORE CL_PathHelp
00041 {
00044
00045 public:
00047 enum PathType
00048 {
00050 path_type_file,
00051
00053 path_type_virtual
00054 };
00055
00102 static CL_String make_absolute(
00103 const CL_String &base_path,
00104 const CL_String &relative_path,
00105 PathType path_type = path_type_file);
00106
00126 static CL_String make_relative(
00127 const CL_String &base_path,
00128 const CL_String &absolute_path,
00129 PathType path_type = path_type_file);
00130
00136 static bool is_absolute(
00137 const CL_String &path,
00138 PathType path_type = path_type_file);
00139
00145 static bool is_relative(
00146 const CL_String &path,
00147 PathType path_type = path_type_file);
00148
00158 static CL_String normalize(
00159 const CL_String &path,
00160 PathType path_type = path_type_file);
00161
00169 static CL_String add_trailing_slash(
00170 const CL_String &path,
00171 PathType path_type = path_type_file);
00172
00179 static CL_String remove_trailing_slash(
00180 const CL_String &path);
00181
00188 static CL_String get_location(
00189 const CL_String &fullname,
00190 PathType path_type = path_type_file);
00191
00199 static CL_String get_basepath(
00200 const CL_String &fullname,
00201 PathType path_type = path_type_file);
00202
00204
00207 static std::vector<CL_String> split_basepath(
00208 const CL_String &fullname,
00209 PathType path_type = path_type_file);
00210
00212
00215 static CL_String get_fullpath(
00216 const CL_String &fullname,
00217 PathType path_type = path_type_file);
00218
00220
00223 static CL_String get_filename(
00224 const CL_String &fullname,
00225 PathType path_type = path_type_file);
00226
00228
00231 static CL_String get_basename(
00232 const CL_String &fullname,
00233 PathType path_type = path_type_file);
00234
00236
00240 static CL_String get_extension(
00241 const CL_String &fullname,
00242 PathType path_type = path_type_file);
00243
00245
00249 static CL_String get_fullname(
00250 const CL_String &fullpath,
00251 const CL_String &filename,
00252 PathType path_type = path_type_file);
00253
00255
00260 static CL_String get_fullname(
00261 const CL_String &fullpath,
00262 const CL_String &filename,
00263 const CL_String &extension,
00264 PathType path_type = path_type_file);
00265
00267
00273 static CL_String get_fullname(
00274 const CL_String &location,
00275 const CL_String &basepath,
00276 const CL_String &filename,
00277 const CL_String &extension,
00278 PathType path_type = path_type_file);
00279
00284 static CL_String combine(const CL_String &part1, const CL_String &part2, PathType path_type = path_type_file);
00286 };
00287