IODA Bundle
FileMapper.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2013 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 /// \file FileMapper.h
12 /// Piotr Kuchta - ECMWF Feb 12
13 
14 #ifndef FileMapper_H
15 #define FileMapper_H
16 
17 #include "eckit/memory/NonCopyable.h"
18 
19 class FileMapper : private eckit::NonCopyable {
20 public:
21 
22  FileMapper(const std::string& pathNameSchema);
23  ~FileMapper();
24 
25  void addRoot(const std::string&);
26  void addRoots(const std::vector<std::string>&);
27  void checkRoots() const;
28 
29  std::string encodeRelative(const std::map<std::string,std::string>& values) const;
30  std::vector<std::string> encode(const std::map<std::string,std::string>& values) const;
31 
32  std::vector<std::string> keywords() const;
33 
34 protected:
35 
36  void parsePathNameSchema(const std::string& pathNameSchema);
37 
38 private:
39  std::vector<std::string> placeholders_;
40  std::vector<std::string> separators_;
41 
42  std::vector<std::string> roots_;
43 
44  std::string patchTime(const std::string&) const;
45 };
46 
47 #endif
std::vector< std::string > encode(const std::map< std::string, std::string > &values) const
Definition: FileMapper.cc:193
std::string encodeRelative(const std::map< std::string, std::string > &values) const
Definition: FileMapper.cc:146
void addRoot(const std::string &)
Definition: FileMapper.cc:101
std::vector< std::string > placeholders_
Definition: FileMapper.h:39
void checkRoots() const
Definition: FileMapper.cc:39
FileMapper(const std::string &pathNameSchema)
Definition: FileMapper.cc:30
std::vector< std::string > roots_
Definition: FileMapper.h:42
std::vector< std::string > separators_
Definition: FileMapper.h:40
std::vector< std::string > keywords() const
Definition: FileMapper.cc:99
std::string patchTime(const std::string &) const
Definition: FileMapper.cc:112
void parsePathNameSchema(const std::string &pathNameSchema)
Definition: FileMapper.cc:66
void addRoots(const std::vector< std::string > &)
Definition: FileMapper.cc:106