]> git.tdb.fi Git - builder.git/blob - source/pattern.h
Document a lot of classes and functions
[builder.git] / source / pattern.h
1 #ifndef PATTERN_H_
2 #define PATTERN_H_
3
4 #include <string>
5
6 /**
7 Stores a filename pattern.  A pattern consists of a prefix and a suffix, and
8 can be applied to a body to form a complete filename.  Either or both of the
9 prefix and suffix may be empty.
10 */
11 class Pattern
12 {
13 private:
14         std::string prefix;
15         std::string suffix;
16
17 public:
18         /** Constructs a pattern from a single string.  The string must have exactly
19         one percent sign (%) to separate the prefix and suffix. */
20         Pattern(const std::string &);
21
22         /** Applies the pattern to a body string. */
23         std::string apply(const std::string &) const;
24 };
25
26 #endif