Skyld AV  0.6
On access virus scanning for Linux
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
StringSet.h
Go to the documentation of this file.
1 /*
2  * File: StringSet.h
3  *
4  * Copyright 2013 Heinrich Schuchardt <xypron.glpk@gmx.de>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 
25 #ifndef STRINGSET_H
26 #define STRINGSET_H
27 
28 #include <set>
29 #include <string>
30 #include <cstring>
31 
36 public:
37 
44  bool operator() (std::string *value1, std::string *value2) const {
45  if (value1->compare(*value2) < 0) {
46  return 1;
47  } else {
48  return 0;
49  };
50  }
51 };
52 
56 class StringSet : std::set<std::string *, StringComperator> {
57 public:
58  StringSet();
59  void add(const char *value);
60  using std::set<std::string *, StringComperator>::begin;
61  using std::set<std::string *, StringComperator>::count;
62  using std::set<std::string *, StringComperator>::end;
63  using std::set<std::string *, StringComperator>::find;
64  int find(const char *value);
65  using std::set<std::string *, StringComperator>::iterator;
66  void print();
67  virtual ~StringSet();
68 };
69 
70 #endif /* STRINGSET_H */
StringSet()
Creates string set.
Definition: StringSet.cc:31
void add(const char *value)
Adds entry to string set.
Definition: StringSet.cc:38
Set of pointers to strings.
Definition: StringSet.h:56
bool operator()(std::string *value1, std::string *value2) const
Compares two strings.
Definition: StringSet.h:44
int find(const char *value)
Finds entry in string set.
Definition: StringSet.cc:50
virtual ~StringSet()
Destroys stringset.
Definition: StringSet.cc:73
Compares two strings.
Definition: StringSet.h:35
void print()
Prints content of string set to console.
Definition: StringSet.cc:63