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
00180 static CL_String remove_trailing_slash(
00181 const CL_String &path,
00182 PathType path_type = path_type_file);
00183
00190 static CL_String get_location(
00191 const CL_String &fullname,
00192 PathType path_type = path_type_file);
00193
00201 static CL_String get_basepath(
00202 const CL_String &fullname,
00203 PathType path_type = path_type_file);
00204
00206
00209 static std::vector<CL_String> split_basepath(
00210 const CL_String &fullname,
00211 PathType path_type = path_type_file);
00212
00214
00217 static CL_String get_fullpath(
00218 const CL_String &fullname,
00219 PathType path_type = path_type_file);
00220
00222
00225 static CL_String get_filename(
00226 const CL_String &fullname,
00227 PathType path_type = path_type_file);
00228
00230
00233 static CL_String get_basename(
00234 const CL_String &fullname,
00235 PathType path_type = path_type_file);
00236
00238
00242 static CL_String get_extension(
00243 const CL_String &fullname,
00244 PathType path_type = path_type_file);
00245
00247
00251 static CL_String get_fullname(
00252 const CL_String &fullpath,
00253 const CL_String &filename,
00254 PathType path_type = path_type_file);
00255
00257
00262 static CL_String get_fullname(
00263 const CL_String &fullpath,
00264 const CL_String &filename,
00265 const CL_String &extension,
00266 PathType path_type = path_type_file);
00267
00269
00275 static CL_String get_fullname(
00276 const CL_String &location,
00277 const CL_String &basepath,
00278 const CL_String &filename,
00279 const CL_String &extension,
00280 PathType path_type = path_type_file);
00282 };
00283