Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/Common/Wildcard.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Common/Wildcard.h
2
3 #ifndef __COMMON_WILDCARD_H
4 #define __COMMON_WILDCARD_H
5
6 #include "MyString.h"
7
8 int CompareFileNames(const UString &s1, const UString &s2);
9
10 void SplitPathToParts(const UString &path, UStringVector &pathParts);
11 void SplitPathToParts(const UString &path, UString &dirPrefix, UString &name);
12 UString ExtractDirPrefixFromPath(const UString &path);
13 UString ExtractFileNameFromPath(const UString &path);
14 bool DoesNameContainWildCard(const UString &path);
15 bool CompareWildCardWithName(const UString &mask, const UString &name);
16
17 namespace NWildcard {
18
19 struct CItem
20 {
21 UStringVector PathParts;
22 bool Recursive;
23 bool ForFile;
24 bool ForDir;
25 bool CheckPath(const UStringVector &pathParts, bool isFile) const;
26 };
27
28 class CCensorNode
29 {
30 CCensorNode *Parent;
31 bool CheckPathCurrent(bool include, const UStringVector &pathParts, bool isFil e) const;
32 void AddItemSimple(bool include, CItem &item);
33 bool CheckPath(UStringVector &pathParts, bool isFile, bool &include) const;
34 public:
35 CCensorNode(): Parent(0) { };
36 CCensorNode(const UString &name, CCensorNode *parent): Name(name), Parent(pare nt) { };
37 UString Name;
38 CObjectVector<CCensorNode> SubNodes;
39 CObjectVector<CItem> IncludeItems;
40 CObjectVector<CItem> ExcludeItems;
41
42 int FindSubNode(const UString &path) const;
43
44 void AddItem(bool include, CItem &item);
45 void AddItem(bool include, const UString &path, bool recursive, bool forFile, bool forDir);
46 void AddItem2(bool include, const UString &path, bool recursive);
47
48 bool NeedCheckSubDirs() const;
49 bool AreThereIncludeItems() const;
50
51 bool CheckPath(const UString &path, bool isFile, bool &include) const;
52 bool CheckPath(const UString &path, bool isFile) const;
53
54 bool CheckPathToRoot(bool include, UStringVector &pathParts, bool isFile) cons t;
55 // bool CheckPathToRoot(const UString &path, bool isFile, bool include) const;
56 void ExtendExclude(const CCensorNode &fromNodes);
57 };
58
59 struct CPair
60 {
61 UString Prefix;
62 CCensorNode Head;
63 CPair(const UString &prefix): Prefix(prefix) { };
64 };
65
66 class CCensor
67 {
68 int FindPrefix(const UString &prefix) const;
69 public:
70 CObjectVector<CPair> Pairs;
71 bool AllAreRelative() const
72 { return (Pairs.Size() == 1 && Pairs.Front().Prefix.IsEmpty()); }
73 void AddItem(bool include, const UString &path, bool recursive);
74 bool CheckPath(const UString &path, bool isFile) const;
75 void ExtendExclude();
76 };
77
78 }
79
80 #endif
OLDNEW
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/Common/UTFConvert.cpp ('k') | third_party/lzma/v4_65/files/CPP/Common/Wildcard.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698