SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FullFileName.h
Go to the documentation of this file.
1 
2 /*
3  For more information, please see: http://software.sci.utah.edu
4 
5  The MIT License
6 
7  Copyright (c) 2009 Scientific Computing and Imaging Institute,
8  University of Utah.
9 
10 
11  Permission is hereby granted, free of charge, to any person obtaining a
12  copy of this software and associated documentation files (the "Software"),
13  to deal in the Software without restriction, including without limitation
14  the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  and/or sell copies of the Software, and to permit persons to whom the
16  Software is furnished to do so, subject to the following conditions:
17 
18  The above copyright notice and this permission notice shall be included
19  in all copies or substantial portions of the Software.
20 
21  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  DEALINGS IN THE SOFTWARE.
28 */
29 /// @todo Documentation Core/Util/Legacy/FullFileName.h
30 
31 #ifndef CORE_UTIL_FILENAME_H
32 #define CORE_UTIL_FILENAME_H 1
33 
34 #include <string>
35 #include <vector>
36 
37 #include <Core/Utils/Legacy/Dir.h>
39 
40 namespace SCIRun {
41 
42 /// @todo: most of the functionality in this class can be replaced with the
43 // boost::filesystem::path class
45 {
46  public:
47  // A class to extract different representations of the filename
48  // The constructor accepts both relative and absolute filepaths
49  FullFileName(std::string filename);
50 
51  // Test whether the path to file exists and if not create it
52  bool create_file_path();
53 
54  std::string get_ext();
55  std::string get_basename();
56  std::string get_filename();
57  std::string get_abs_path();
58 
59  // Make path/filename relative to another path
60  std::string get_rel_path();
61  std::string get_rel_path(std::string path);
62  std::string get_rel_path(Dir path);
63 
64  std::string get_rel_filename();
65  std::string get_rel_filename(std::string dir);
66  std::string get_rel_filename(Dir dir);
67 
68  // Get the absolute path
69  std::string get_abs_filename();
70 
71  private:
72 
73  std::string make_relative_filename(std::string name, std::string path);
74  std::string make_absolute_filename(std::string name);
75 
76  std::string name_;
77 };
78 
79 
80 } // End namespace SCIRun
81 
82 #endif
#define SCISHARE
Definition: share.h:39
string dir
Definition: eab.py:5
const char * name[]
Definition: BoostGraphExampleTests.cc:87
Definition: Dir.h:75
Definition: FullFileName.h:44