00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __OP_BundlePattern__
00021 #define __OP_BundlePattern__
00022
00023 #include "OP_API.h"
00024 #include <UT/UT_Assert.h>
00025
00026 class OP_Node;
00027 class OP_BundleFilter;
00028
00029 class OP_API OP_BundlePattern {
00030 public:
00031 static OP_BundlePattern *allocPattern(const char *str);
00032 static void freePattern(OP_BundlePattern *pattern);
00033
00034 int argc() const { return myArgc; }
00035 const char *argv(int i) const
00036 {
00037 UT_ASSERT(i >= 0 && i < myArgc);
00038 return myArgv[i];
00039 }
00040
00041 bool hasRelativePath() const { return myRelativePath; }
00042 bool isAsterisk() const { return myAsterisk; }
00043 bool isNullPattern() const { return myNullPattern; }
00044
00045 bool hasPattern(const char *str) const;
00046
00047 bool match(const OP_Node *node, const char *relativepath,
00048 bool assume_kids_included) const;
00049
00050
00051
00052 bool matchNode(const OP_Node *node,
00053 const char *relativetopath,
00054 bool result_if_no_match,
00055 int *excluded) const;
00056
00057 protected:
00058 OP_BundlePattern(const char *str);
00059 ~OP_BundlePattern();
00060
00061 private:
00062 const char *myPatternString;
00063 char **myArgv;
00064 int myArgc;
00065 int myRefCount;
00066 bool myRelativePath;
00067 bool myAsterisk;
00068 bool myNullPattern;
00069 };
00070 #endif
00071