Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXPath.h
1 /********************************************************************************
2 * *
3 * P a t h N a m e M a n i p u l a t i o n *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXPATH_H
22 #define FXPATH_H
23 
24 namespace FX {
25 
26 namespace FXPath {
27 
29  enum {
30  PathName = 1,
31  NoEscape = 2,
32  DotFile = 4,
33  LeadDir = 8,
34  CaseFold = 16
35  };
36 
42  extern FXAPI FXString root(const FXString& file);
43 
49  extern FXAPI FXString share(const FXString& file);
50 
56  extern FXAPI FXString directory(const FXString& file);
57 
63  extern FXAPI FXString name(const FXString& file);
64 
66  extern FXAPI FXString title(const FXString& file);
67 
75  extern FXAPI FXString extension(const FXString& file);
76 
80  extern FXAPI FXString stripExtension(const FXString& file);
81 
85  extern FXAPI FXString drive(const FXString& file);
86 
94  extern FXAPI FXString expand(const FXString& file);
95 
97  extern FXAPI FXString contract(const FXString& file,const FXString& user=FXString::null,const FXString& var=FXString::null);
98 
106  extern FXAPI FXString simplify(const FXString& file);
107 
109  extern FXAPI FXString absolute(const FXString& file);
110 
112  extern FXAPI FXString absolute(const FXString& base,const FXString& file);
113 
115  extern FXAPI FXString relative(const FXString& file);
116 
118  extern FXAPI FXString relative(const FXString& base,const FXString& file);
119 
121  extern FXAPI FXString convert(const FXString& file,FXchar septo=PATHSEP,FXchar sepfm='/');
122 
124  extern FXAPI FXString upLevel(const FXString& file);
125 
127  extern FXAPI FXbool isInside(const FXString& base,const FXString& file);
128 
130  extern FXAPI FXbool isAbsolute(const FXString& file);
131 
133  extern FXAPI FXbool isTopDirectory(const FXString& file);
134 
136  extern FXAPI FXbool isShare(const FXString& file);
137 
139  extern FXAPI FXbool isHidden(const FXString& file);
140 
142  extern FXAPI FXString validPath(const FXString& file);
143 
145  extern FXAPI FXbool isValidPath(const FXString& file);
146 
148  extern FXAPI FXString enquote(const FXString& file,FXbool force=false);
149 
151  extern FXAPI FXString dequote(const FXString& file);
152 
163  extern FXAPI FXint parseArgs(FXchar**& argv,const FXchar* command);
164 
169  extern FXAPI FXint parseArgs(FXchar**& argv,const FXString& command);
170 
198  extern FXAPI FXbool match(const FXchar* string,const FXchar* pattern="*",FXuint flags=(NoEscape|PathName));
199 
203  extern FXAPI FXbool match(const FXString& file,const FXchar* pattern="*",FXuint flags=(NoEscape|PathName));
204 
208  extern FXAPI FXbool match(const FXString& file,const FXString& pattern,FXuint flags=(NoEscape|PathName));
209 
215  extern FXAPI FXString unique(const FXString& file);
216 
221  extern FXAPI FXString search(const FXString& pathlist,const FXString& file);
222 
227  extern FXAPI FXString relativize(const FXString& pathlist,const FXString& file);
228 
233  extern FXAPI FXbool hasExecExtension(const FXString& file);
234  }
235 
236 }
237 
238 #endif

Copyright © 1997-2016 Jeroen van der Zijp