Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
mia
core
filetools.hh
Go to the documentation of this file.
1
/* -*- mia-c++ -*-
2
*
3
* This file is part of MIA - a toolbox for medical image analysis
4
* Copyright (c) Leipzig, Madrid 1999-2013 Gert Wollny
5
*
6
* MIA is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
18
*
19
*/
20
21
#ifndef MIA_FILETOOLS_HH
22
#define MIA_FILETOOLS_HH
23
24
#include <string>
25
#include <vector>
26
27
#include <
mia/core/defines.hh
>
28
#include <boost/filesystem/path.hpp>
29
30
NS_MIA_BEGIN
31
32
typedef
std::vector<boost::filesystem::path>
CPathNameArray
;
33
34
CPathNameArray
find_files
(
const
CPathNameArray
& searchpath,
const
std::string& pattern);
35
45
EXPORT_CORE
std::vector<std::string>
get_consecutive_numbered_files
(std::string
const
& in_filename);
46
59
EXPORT_CORE
const
std::string
get_filename_pattern_and_range
(std::string
const
& in_filename,
size_t
& min,
size_t
& max,
size_t
& format_width);
60
61
72
EXPORT_CORE
std::vector<std::string>
get_consecutive_numbered_files_from_pattern
(std::string
const
& in_filename,
int
start,
int
end);
73
84
EXPORT_CORE
size_t
fname_to_cformat
(
const
char
*fname, std::string& base,
bool
wildcard);
85
93
EXPORT_CORE
void
split_dir_fname
(
const
char
*in_name, std::string& dir, std::string& sname);
94
95
104
EXPORT_CORE
std::string
create_filename
(
const
char
*cformat,
size_t
num);
105
113
EXPORT_CORE
size_t
get_filename_number_pattern_width
(std::string
const
& in_filename);
114
125
EXPORT_CORE
size_t
get_filename_number_pattern
(std::string
const
& infilename, std::string& base, std::string& suffix);
126
137
EXPORT_CORE
void
split_filename_number_pattern
(std::string
const
& in_filename, std::string& base,
138
std::string& suffix, std::string& number);
139
140
NS_MIA_END
141
142
#endif
Generated on Tue Oct 15 2013 13:56:37 by
1.8.4