]> git.tdb.fi Git - builder.git/blobdiff - source/pattern.h
Move the bpk files into a subdirectory and install them
[builder.git] / source / pattern.h
index de8e7b2de962b8a1b1bb33ea887000e42b72202c..5965efaed69886ea489679f93b0e0d13774eef4d 100644 (file)
@@ -1,8 +1,14 @@
 #ifndef PATTERN_H_
 #define PATTERN_H_
 
+#include <list>
 #include <string>
 
+/**
+Stores a filename pattern.  A pattern consists of a prefix and a suffix, and
+can be applied to a body to form a complete filename.  Either or both of the
+prefix and suffix may be empty.
+*/
 class Pattern
 {
 private:
@@ -10,9 +16,15 @@ private:
        std::string suffix;
 
 public:
+       /** Constructs a pattern from a single string.  The string must have exactly
+       one percent sign (%) to separate the prefix and suffix. */
        Pattern(const std::string &);
 
+       /** Applies the pattern to a body string. */
        std::string apply(const std::string &) const;
+
+       /** Applies a list of patterns to the same body. */
+       static std::list<std::string> apply_list(const std::list<Pattern> &, const std::string &);
 };
 
 #endif