Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
testIoTools.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Test functions in vpIoTools.
32  *
33  * Authors:
34  * Souriya Trinh
35  *
36  *****************************************************************************/
37 
44 #include <stdio.h>
45 #include <string.h>
46 #include <iostream>
47 #include <visp3/core/vpIoTools.h>
48 
49 
50 int
51 main(int argc, const char ** argv)
52 {
53  const char c = vpIoTools::separator;
54  if(c == '\\')
55  {
56  std::cout << "The directory separator character is '" << c << "' (Windows platform)." << std::endl;
57  }
58  else {
59  std::cout << "The directory separator character is '" << c << "' (Unix like platform)." << std::endl;
60  }
61 
62 #if defined(_WIN32)
63  std::string pathname = "C:\\Program Files (x86)\\Java\\jre7";
64 #else
65  std::string pathname = "/usr/bin/java";
66 #endif
67 
68  std::cout << "Parent of " << pathname << " is " << vpIoTools::getParent(pathname) << std::endl;
69  std::cout << "Name of " << pathname << " is " << vpIoTools::getName(pathname) << std::endl;
70 
71 
72  if(argc == 3 && std::string(argv[1]) == std::string("-i"))
73  {
74  std::cout << "Parent of " << argv[2] << " is " << vpIoTools::getParent(argv[2]) << std::endl;
75  std::cout << "Name of " << argv[2] << " is " << vpIoTools::getName(argv[2]) << std::endl;
76  }
77 
78  std::string windowsPathnameStyle = "\\usr\\bin\\java";
79  std::cout << "Parent of " << windowsPathnameStyle << " is " << vpIoTools::getParent(windowsPathnameStyle) << std::endl;
80  std::cout << "Name of " << windowsPathnameStyle << " is " << vpIoTools::getName(windowsPathnameStyle) << std::endl;
81 
82  std::string parent = "/usr/toto/", child = "\\blabla\\java";
83  std::cout << "parent=" << vpIoTools::path(parent) << " ; child=" << vpIoTools::path(child) << std::endl;
84  std::cout << "Create file path from parent=" << parent << " and child=" << child << " is "
85  << vpIoTools::createFilePath(parent, child) << std::endl;
86 
87  std::string expandPath = "~/Documents/fictional directory/fictional file";
88  std::cout << "Path for " << expandPath << " is " << vpIoTools::path(expandPath) << std::endl;
89 
90  std::cout << "Test get name with an empty pathname=" << vpIoTools::getName("") << std::endl;
91  std::cout << "Get parent with an empty pathname=" << vpIoTools::getParent("") << std::endl;
92  std::cout << "Get parent with a filename=" << vpIoTools::getParent("my_file.txt") << std::endl;
93  expandPath = "~/Documents/fictional dir/fictional file.txt";
94  std::cout << "Get name with a unix expand pathname " << expandPath << "=" << vpIoTools::getName(expandPath) << std::endl;
95  std::cout << "Get parent with a unix expand pathname " << expandPath << "=" << vpIoTools::getParent(expandPath) << std::endl;
96 
97 
98  pathname = "c:/dir";
99  std::cout << "pathname=" << vpIoTools::splitDrive(pathname).first << " ; " << vpIoTools::splitDrive(pathname).second << std::endl;
100 
101  std::cout << "isAbsolutePath of " << pathname << "=" << vpIoTools::isAbsolutePathname(pathname) << std::endl;
102 
103  pathname = "c:/dir/fictional directory/fictional file.txt";
104  std::cout << "isAbsolutePath of " << pathname << "=" << vpIoTools::isAbsolutePathname(pathname) << std::endl;
105 
106  pathname = "/home/user/Documents/fictional directory/fictional file.txt";
107  std::cout << "isAbsolutePath of " << pathname << "=" << vpIoTools::isAbsolutePathname(pathname) << std::endl;
108 
109  pathname = "~/Documents/fictional directory/fictional file.txt";
110  std::cout << "isAbsolutePath of " << pathname << "=" << vpIoTools::isAbsolutePathname(pathname) << std::endl;
111 
112  pathname = "fictional directory/fictional file.txt";
113  std::cout << "isAbsolutePath of " << pathname << "=" << vpIoTools::isAbsolutePathname(pathname) << std::endl;
114 
115 
116  //Test vpIoTools::splitDrive
117  unsigned int nbFail = 0, nbOk = 0;
118 #if defined(_WIN32)
119  if(strcmp(vpIoTools::splitDrive("c:\\foo\\bar").first.c_str(), "c:") == 0) {
120  nbOk++;
121  }
122  else {
123  nbFail++;
124  std::cout << "Fail=" << vpIoTools::splitDrive("c:\\foo\\bar").first << " should be=c:" << std::endl;
125  }
126  if(strcmp(vpIoTools::splitDrive("c:\\foo\\bar").second.c_str(), "\\foo\\bar") == 0) {
127  nbOk++;
128  }
129  else {
130  nbFail++;
131  std::cout << "Fail=" << vpIoTools::splitDrive("c:\\foo\\bar").second << " should be=\\foo\\bar" << std::endl;
132  }
133 
134  if(strcmp(vpIoTools::splitDrive("c:/foo/bar").first.c_str(), "c:") == 0) {
135  nbOk++;
136  }
137  else {
138  nbFail++;
139  std::cout << "Fail=" << vpIoTools::splitDrive("c:/foo/bar").first << " should be=c:" << std::endl;
140  }
141  if(strcmp(vpIoTools::splitDrive("c:/foo/bar").second.c_str(), "/foo/bar") == 0) {
142  nbOk++;
143  }
144  else {
145  nbFail++;
146  std::cout << "Fail=" << vpIoTools::splitDrive("c:/foo/bar").second << " should be=/foo/bar" << std::endl;
147  }
148 
149  if(strcmp(vpIoTools::splitDrive("\\\\conky\\mountpoint\\foo\\bar").first.c_str(), "\\\\conky\\mountpoint") == 0) {
150  nbOk++;
151  }
152  else {
153  nbFail++;
154  std::cout << "Fail=" << vpIoTools::splitDrive("\\\\conky\\mountpoint\\foo\\bar").first << " should be=\\\\conky\\mountpoint" << std::endl;
155  }
156  if(strcmp(vpIoTools::splitDrive("\\\\conky\\mountpoint\\foo\\bar").second.c_str(), "\\foo\\bar") == 0) {
157  nbOk++;
158  }
159  else {
160  nbFail++;
161  std::cout << "Fail=" << vpIoTools::splitDrive("\\\\conky\\mountpoint\\foo\\bar").second << " should be=\\foo\\bar" << std::endl;
162  }
163 
164  if(strcmp(vpIoTools::splitDrive("//conky/mountpoint/foo/bar").first.c_str(), "//conky/mountpoint") == 0) {
165  nbOk++;
166  }
167  else {
168  nbFail++;
169  std::cout << "Fail=" << vpIoTools::splitDrive("//conky/mountpoint/foo/bar").first << " should be=//conky/mountpoint" << std::endl;
170  }
171  if(strcmp(vpIoTools::splitDrive("//conky/mountpoint/foo/bar").second.c_str(), "/foo/bar") == 0) {
172  nbOk++;
173  }
174  else {
175  nbFail++;
176  std::cout << "Fail=" << vpIoTools::splitDrive("//conky/mountpoint/foo/bar").second << " should be=/foo/bar" << std::endl;
177  }
178 
179  if(strcmp(vpIoTools::splitDrive("\\\\\\conky\\mountpoint\\foo\\bar").first.c_str(), "") == 0) {
180  nbOk++;
181  }
182  else {
183  nbFail++;
184  std::cout << "Fail=" << vpIoTools::splitDrive("\\\\\\conky\\mountpoint\\foo\\bar").first << " should be=" << std::endl;
185  }
186  if(strcmp(vpIoTools::splitDrive("\\\\\\conky\\mountpoint\\foo\\bar").second.c_str(),
187  "\\\\\\conky\\mountpoint\\foo\\bar") == 0) {
188  nbOk++;
189  }
190  else {
191  nbFail++;
192  std::cout << "Fail=" << vpIoTools::splitDrive("\\\\\\conky\\mountpoint\\foo\\bar").second << " should be=\\\\\\conky\\mountpoint\\foo\\bar" << std::endl;
193  }
194 
195  if(strcmp(vpIoTools::splitDrive("///conky/mountpoint/foo/bar").first.c_str(), "") == 0) {
196  nbOk++;
197  }
198  else {
199  nbFail++;
200  std::cout << "Fail=" << vpIoTools::splitDrive("///conky/mountpoint/foo/bar").first << " should be=" << std::endl;
201  }
202  if(strcmp(vpIoTools::splitDrive("///conky/mountpoint/foo/bar").second.c_str(), "///conky/mountpoint/foo/bar") == 0) {
203  nbOk++;
204  }
205  else {
206  nbFail++;
207  std::cout << "Fail=" << vpIoTools::splitDrive("///conky/mountpoint/foo/bar").second << " should be=///conky/mountpoint/foo/bar" << std::endl;
208  }
209 
210  if(strcmp(vpIoTools::splitDrive("\\\\conky\\\\mountpoint\\foo\\bar").first.c_str(), "") == 0) {
211  nbOk++;
212  }
213  else {
214  nbFail++;
215  std::cout << "Fail=" << vpIoTools::splitDrive("\\\\conky\\\\mountpoint\\foo\\bar").first << " should be=" << std::endl;
216  }
217  if(strcmp(vpIoTools::splitDrive("\\\\conky\\\\mountpoint\\foo\\bar").second.c_str(),
218  "\\\\conky\\\\mountpoint\\foo\\bar") == 0) {
219  nbOk++;
220  }
221  else {
222  nbFail++;
223  std::cout << "Fail=" << vpIoTools::splitDrive("\\\\conky\\\\mountpoint\\foo\\bar").second << " should be=\\\\conky\\\\mountpoint\\foo\\bar" << std::endl;
224  }
225 
226  if(strcmp(vpIoTools::splitDrive("//conky//mountpoint/foo/bar").first.c_str(), "") == 0) {
227  nbOk++;
228  }
229  else {
230  nbFail++;
231  std::cout << "Fail=" << vpIoTools::splitDrive("//conky//mountpoint/foo/bar").first << " should be=" << std::endl;
232  }
233  if(strcmp(vpIoTools::splitDrive("//conky//mountpoint/foo/bar").second.c_str(), "//conky//mountpoint/foo/bar") == 0) {
234  nbOk++;
235  }
236  else {
237  nbFail++;
238  std::cout << "Fail=" << vpIoTools::splitDrive("//conky//mountpoint/foo/bar").second << " should be=//conky//mountpoint/foo/bar" << std::endl;
239  }
240 
241  std::cout << "Test vpIoTools::splitDrive (Win32) - passed: " << nbOk << "/" << (nbOk+nbFail) << std::endl;
242 
243  if (nbFail > 0) {
244  std::cerr << "Failed test: vpIoTools::splitDrive (Win32)" << std::endl;
245  return EXIT_FAILURE;
246  }
247 #endif
248 
249 
250  //Test vpIoTools::getFileExtension
251 #if defined(_WIN32)
252  nbFail = 0;
253  nbOk = 0;
254 
255  if(strcmp(vpIoTools::getFileExtension("foo.ext").c_str(), ".ext") == 0) {
256  nbOk++;
257  }
258  else {
259  nbFail++;
260  std::cout << "Fail=" << vpIoTools::getFileExtension("foo.ext") << " should be=.ext" << std::endl;
261  }
262 
263  if(strcmp(vpIoTools::getFileExtension("/foo/foo.ext").c_str(), ".ext") == 0) {
264  nbOk++;
265  }
266  else {
267  nbFail++;
268  std::cout << "Fail=" << vpIoTools::getFileExtension("/foo/foo.ext") << " should be=.ext" << std::endl;
269  }
270 
271  if(strcmp(vpIoTools::getFileExtension(".ext").c_str(), "") == 0) {
272  nbOk++;
273  }
274  else {
275  nbFail++;
276  std::cout << "Fail=" << vpIoTools::getFileExtension(".ext") << " should be=" << std::endl;
277  }
278 
279  if(strcmp(vpIoTools::getFileExtension("\\foo.ext\\foo").c_str(), "") == 0) {
280  nbOk++;
281  }
282  else {
283  nbFail++;
284  std::cout << "Fail=" << vpIoTools::getFileExtension("\\foo.ext\\foo") << " should be=" << std::endl;
285  }
286 
287  if(strcmp(vpIoTools::getFileExtension("foo.ext\\").c_str(), "") == 0) {
288  nbOk++;
289  }
290  else {
291  nbFail++;
292  std::cout << "Fail=" << vpIoTools::getFileExtension("foo.ext\\") << " should be=" << std::endl;
293  }
294 
295  if(strcmp(vpIoTools::getFileExtension("").c_str(), "") == 0) {
296  nbOk++;
297  }
298  else {
299  nbFail++;
300  std::cout << "Fail=" << vpIoTools::getFileExtension("") << " should be=" << std::endl;
301  }
302 
303  if(strcmp(vpIoTools::getFileExtension("foo.bar.ext").c_str(), ".ext") == 0) {
304  nbOk++;
305  }
306  else {
307  nbFail++;
308  std::cout << "Fail=" << vpIoTools::getFileExtension("foo.bar.ext") << " should be=.ext" << std::endl;
309  }
310 
311  if(strcmp(vpIoTools::getFileExtension("xx/foo.bar.ext").c_str(), ".ext") == 0) {
312  nbOk++;
313  }
314  else {
315  nbFail++;
316  std::cout << "Fail=" << vpIoTools::getFileExtension("xx/foo.bar.ext") << " should be=.ext" << std::endl;
317  }
318 
319  if(strcmp(vpIoTools::getFileExtension("xx\\foo.bar.ext").c_str(), ".ext") == 0) {
320  nbOk++;
321  }
322  else {
323  nbFail++;
324  std::cout << "Fail=" << vpIoTools::getFileExtension("xx\\foo.bar.ext") << " should be=.ext" << std::endl;
325  }
326 
327  if(strcmp(vpIoTools::getFileExtension("c:a/b\\c.d").c_str(), ".d") == 0) {
328  nbOk++;
329  }
330  else {
331  nbFail++;
332  std::cout << "Fail=" << vpIoTools::getFileExtension("c:a/b\\c.d") << " should be=.d" << std::endl;
333  }
334 
335  std::cout << "Test vpIoTools::getFileExtension (WIN32 platform) - passed: " << nbOk << "/" << (nbOk+nbFail) << std::endl;
336 
337  if (nbFail > 0) {
338  std::cerr << "Failed test: vpIoTools::getFileExtension (WIN32 platform)" << std::endl;
339  return EXIT_FAILURE;
340  }
341 #else
342  nbFail = 0;
343  nbOk = 0;
344 
345  if(strcmp(vpIoTools::getFileExtension("foo.bar").c_str(), ".bar") == 0) {
346  nbOk++;
347  }
348  else {
349  nbFail++;
350  std::cout << "Fail=" << vpIoTools::getFileExtension("foo.bar") << " should be=.bar" << std::endl;
351  }
352 
353  if(strcmp(vpIoTools::getFileExtension("foo.boo.bar").c_str(), ".bar") == 0) {
354  nbOk++;
355  }
356  else {
357  nbFail++;
358  std::cout << "Fail=" << vpIoTools::getFileExtension("foo.boo.bar") << " should be=.bar" << std::endl;
359  }
360 
361  if(strcmp(vpIoTools::getFileExtension("foo.boo.biff.bar").c_str(), ".bar") == 0) {
362  nbOk++;
363  }
364  else {
365  nbFail++;
366  std::cout << "Fail=" << vpIoTools::getFileExtension("foo.boo.biff.bar") << " should be=.bar" << std::endl;
367  }
368 
369  if(strcmp(vpIoTools::getFileExtension(".csh.rc").c_str(), ".rc") == 0) {
370  nbOk++;
371  }
372  else {
373  nbFail++;
374  std::cout << "Fail=" << vpIoTools::getFileExtension(".csh.rc") << " should be=.rc" << std::endl;
375  }
376 
377  if(strcmp(vpIoTools::getFileExtension("nodots").c_str(), "") == 0) {
378  nbOk++;
379  }
380  else {
381  nbFail++;
382  std::cout << "Fail=" << vpIoTools::getFileExtension("nodots") << " should be=" << std::endl;
383  }
384 
385  if(strcmp(vpIoTools::getFileExtension(".cshrc").c_str(), "") == 0) {
386  nbOk++;
387  }
388  else {
389  nbFail++;
390  std::cout << "Fail=" << vpIoTools::getFileExtension(".cshrc") << " should be=" << std::endl;
391  }
392 
393  if(strcmp(vpIoTools::getFileExtension("...manydots").c_str(), "") == 0) {
394  nbOk++;
395  }
396  else {
397  nbFail++;
398  std::cout << "Fail=" << vpIoTools::getFileExtension("...manydots") << " should be=" << std::endl;
399  }
400 
401  if(strcmp(vpIoTools::getFileExtension("...manydots.ext").c_str(), ".ext") == 0) {
402  nbOk++;
403  }
404  else {
405  nbFail++;
406  std::cout << "Fail=" << vpIoTools::getFileExtension("...manydots.ext") << " should be=.ext" << std::endl;
407  }
408 
409  if(strcmp(vpIoTools::getFileExtension(".").c_str(), "") == 0) {
410  nbOk++;
411  }
412  else {
413  nbFail++;
414  std::cout << "Fail=" << vpIoTools::getFileExtension(".") << " should be=" << std::endl;
415  }
416 
417  if(strcmp(vpIoTools::getFileExtension("..").c_str(), "") == 0) {
418  nbOk++;
419  }
420  else {
421  nbFail++;
422  std::cout << "Fail=" << vpIoTools::getFileExtension("..") << " should be=" << std::endl;
423  }
424 
425  if(strcmp(vpIoTools::getFileExtension("........").c_str(), "") == 0) {
426  nbOk++;
427  }
428  else {
429  nbFail++;
430  std::cout << "Fail=" << vpIoTools::getFileExtension("........") << " should be=" << std::endl;
431  }
432 
433  if(strcmp(vpIoTools::getFileExtension("").c_str(), "") == 0) {
434  nbOk++;
435  }
436  else {
437  nbFail++;
438  std::cout << "Fail=" << vpIoTools::getFileExtension("") << " should be=" << std::endl;
439  }
440 
441  std::cout << "Test vpIoTools::getFileExtension (Unix-like platform) - passed: " << nbOk << "/" << (nbOk+nbFail) << std::endl;
442 #endif
443 
444 
445  //Test isSamePathname()
446 #if defined(_WIN32)
447  std::string path1 = "tmp/test/file.txt";
448  std::string path2 = "tmp/test/../test/file.txt";
449 
450  nbOk = 0;
451  nbFail = 0;
452  bool res;
453 
454  res = vpIoTools::isSamePathname(path1, path2); //True
455  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
456  nbOk = res ? nbOk+1 : nbOk;
457  nbFail = res ? nbFail : nbFail+1;
458 
459  path1 = ".\\tmp/test/file.txt";
460  res = vpIoTools::isSamePathname(path1, path2); //True
461  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
462  nbOk = res ? nbOk+1 : nbOk;
463  nbFail = res ? nbFail : nbFail+1;
464 
465  path1 = ".\\tmp/test\\../fake dir/..\\test\\file.txt";
466  res = vpIoTools::isSamePathname(path1, path2); //True
467  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
468  nbOk = res ? nbOk+1 : nbOk;
469  nbFail = res ? nbFail : nbFail+1;
470 
471  path2 = "/tmp/test/../test/file.txt";
472  res = vpIoTools::isSamePathname(path1, path2); //False
473  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
474  nbOk = res ? nbOk : nbOk+1;
475  nbFail = res ? nbFail+1 : nbFail;
476 
477  std::cout << "Test vpIoTools::isSamePathname (WIN32 platform) - passed: " << nbOk << "/" << (nbOk+nbFail) << std::endl;
478  if (nbFail > 0) {
479  std::cerr << "Failed test: vpIoTools::isSamePathname (WIN32 platform)" << std::endl;
480  return EXIT_FAILURE;
481  }
482 #else
483  //realpath requires not fake path, so we create dummy file and directories
484 
485  // Get the user login name
486  std::string username = "";
487  vpIoTools::getUserName(username);
488  vpIoTools::makeDirectory("/tmp/" + username);
489  vpIoTools::makeDirectory("/tmp/" + username + "/test");
490  vpIoTools::makeDirectory("/tmp/" + username + "/dummy dir");
491 
492  std::string path1 = "/tmp/" + username + "/test/file.txt";
493  std::string path2 = "/tmp/" + username + "/test/../test/file.txt";
494  std::ofstream dummy_file(path1.c_str());
495  if (!dummy_file.is_open()) {
496  return EXIT_SUCCESS;
497  }
498  dummy_file.close();
499 
500  nbOk = 0;
501  nbFail = 0;
502  bool res;
503 
504  res = vpIoTools::isSamePathname(path1, path2); //True
505  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
506  nbOk = res ? nbOk+1 : nbOk;
507  nbFail = res ? nbFail : nbFail+1;
508 
509  path1 = "\\tmp/" + username + "/./test/file.txt";
510  res = vpIoTools::isSamePathname(path1, path2); //True
511  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
512  nbOk = res ? nbOk+1 : nbOk;
513  nbFail = res ? nbFail : nbFail+1;
514 
515  path1 = "\\tmp/" + username + "/test\\../dummy dir/..\\test\\file.txt";
516  res = vpIoTools::isSamePathname(path1, path2); //True
517  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
518  nbOk = res ? nbOk+1 : nbOk;
519  nbFail = res ? nbFail : nbFail+1;
520 
521  path2 = "/tmp/" + username + "/test/../test";
522  res = vpIoTools::isSamePathname(path1, path2); //False
523  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
524  nbOk = res ? nbOk : nbOk+1;
525  nbFail = res ? nbFail+1 : nbFail;
526 
527  path1 = "/tmp/" + username + "/test/";
528  res = vpIoTools::isSamePathname(path1, path2); //True
529  std::cout << "vpIoTools::isSamePathname(" << path1 << ", " << path2 << ")? " << res << std::endl;
530  nbOk = res ? nbOk+1 : nbOk;
531  nbFail = res ? nbFail : nbFail+1;
532 
533  std::cout << "Test vpIoTools::isSamePathname (Unix platform) - passed: " << nbOk << "/" << (nbOk+nbFail) << std::endl;
534  if (nbFail > 0) {
535  std::cerr << "Failed test: vpIoTools::isSamePathname (Unix platform)" << std::endl;
536  return EXIT_FAILURE;
537  }
538 #endif
539 
540 
541  std::cout << std::endl << "End" << std::endl;
542  return EXIT_SUCCESS;
543 }
static bool isAbsolutePathname(const std::string &pathname)
Definition: vpIoTools.cpp:1412
static std::string getFileExtension(const std::string &pathname, const bool checkFile=false)
Definition: vpIoTools.cpp:1191
static const char separator
Definition: vpIoTools.h:181
static std::string path(const char *pathname)
Definition: vpIoTools.cpp:770
static std::string getParent(const std::string &pathname)
Definition: vpIoTools.cpp:1306
static void makeDirectory(const char *dirname)
Definition: vpIoTools.cpp:427
static std::string createFilePath(const std::string &parent, const std::string child)
Definition: vpIoTools.cpp:1366
static std::pair< std::string, std::string > splitDrive(const std::string &pathname)
Definition: vpIoTools.cpp:1454
static bool isSamePathname(const std::string &pathname1, const std::string &pathname2)
Definition: vpIoTools.cpp:1435
static std::string getUserName()
Definition: vpIoTools.cpp:177
static std::string getName(const std::string &pathname)
Definition: vpIoTools.cpp:1271