forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathppFilenamePattern.h
More file actions
45 lines (37 loc) · 1.36 KB
/
ppFilenamePattern.h
File metadata and controls
45 lines (37 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Filename: ppFilenamePattern.h
// Created by: drose (25Sep00)
//
////////////////////////////////////////////////////////////////////
#ifndef PPFILENAMEPATTERN_H
#define PPFILENAMEPATTERN_H
#include "ppremake.h"
///////////////////////////////////////////////////////////////////
// Class : PPFilenamePattern
// Description : This is a string that represents a filename, or a
// family of filenames, using the make convention that a
// wildcard sign (PATTERN_WILDCARD, typically '%') in
// the filename represents any sequence of characters.
////////////////////////////////////////////////////////////////////
class PPFilenamePattern {
public:
PPFilenamePattern(const string &pattern);
PPFilenamePattern(const PPFilenamePattern ©);
void operator = (const PPFilenamePattern ©);
bool has_wildcard() const;
string get_pattern() const;
const string &get_prefix() const;
const string &get_suffix() const;
bool matches(const string &filename) const;
string extract_body(const string &filename) const;
string transform(const string &filename,
const PPFilenamePattern &transform_from) const;
private:
bool _has_wildcard;
string _prefix;
string _suffix;
};
inline ostream &
operator << (ostream &out, const PPFilenamePattern &pattern) {
return out << pattern.get_pattern();
}
#endif