libUTL++
FileSpec.h
1 #pragma once
2 
4 
5 #include <libutl/String.h>
6 
8 
9 UTL_NS_BEGIN;
10 
12 
13 class Regex;
14 
16 
30 
32 class FileSpec : public String
33 {
35 
36 public:
41  FileSpec(const String& fileSpec)
42  {
43  init();
44  set(fileSpec);
45  compile();
46  }
47 
52  FileSpec(const char* fileSpec)
53  {
54  init();
55  set(fileSpec);
56  compile();
57  }
58 
59  virtual int compare(const Object& rhs) const;
60 
61  virtual void copy(const Object& rhs);
62 
63  virtual void steal(Object& rhs);
64 
65  virtual void serialize(Stream& stream, uint_t io, uint_t mode = ser_default);
66 
68  void compile();
69 
70 private:
71  void init();
72  void deInit();
73  Regex* _regex;
74 };
75 
77 
78 UTL_NS_END;
void serialize(bool &b, Stream &stream, uint_t io, uint_t mode=ser_default)
Serialize a boolean.
void deInit()
De-initialize UTL++.
default representation (via getSerializeMode())
Definition: util.h:75
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Definition: macros.h:688
Character string.
Definition: String.h:31
void copy(T *dest, const T *src, size_t len)
Copy one array of objects to another.
Definition: util_inl.h:690
unsigned int uint_t
Unsigned integer.
Definition: types.h:59
Stream I/O abstraction.
Definition: Stream.h:68
FileSpec(const String &fileSpec)
Constructor.
Definition: FileSpec.h:41
FileSpec(const char *fileSpec)
Constructor.
Definition: FileSpec.h:52
Regular expression.
Definition: Regex.h:133
FileSpec does shell-style filename globbing.
Definition: FileSpec.h:32
Root of UTL++ class hierarchy.
Definition: Object.h:52
int compare(bool lhs, bool rhs)
Compare two boolean values.
void init()
Initialize UTL++.