OTest2
A C++ testing framework
tags.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Ondrej Starek
3  *
4  * This file is part of OTest2
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2_INCLUDE_OTEST2_TAGS_H_
21 #define OTest2_INCLUDE_OTEST2_TAGS_H_
22 
23 #include <initializer_list>
24 #include <string>
25 #include <vector>
26 
27 namespace OTest2 {
28 
32 class Tags {
33  private:
34  std::vector<std::string> tags;
35 
36  public:
40  Tags();
41 
45  /* implicit */ Tags(
46  std::initializer_list<std::string> initializer_);
47 
51  Tags(
52  const Tags& other_);
53 
57  Tags(
58  Tags&& other_) noexcept;
59 
63  ~Tags();
64 
68  void swap(
69  Tags& other_) noexcept;
70 
75  const Tags& other_);
76 
81  Tags&& other_) noexcept;
82 
86  void appendTag(
87  const std::string& tag_);
88 
95  bool findTag(
96  const std::string& tag_) const noexcept;
97 
101  bool isEmpty() const noexcept;
102 };
103 
104 } /* -- namespace OTest2 */
105 
106 #endif /* -- OTest2_INCLUDE_OTEST2_TAGS_H_ */
OTest2::Tags::isEmpty
bool isEmpty() const noexcept
Check if the list is empty.
Definition: tags.cpp:85
OTest2::Tags::swap
void swap(Tags &other_) noexcept
Swap contents.
Definition: tags.cpp:54
OTest2::Tags::findTag
bool findTag(const std::string &tag_) const noexcept
Find a tag in the list.
Definition: tags.cpp:77
OTest2::Tags::Tags
Tags()
Ctor - empty list of tags.
Definition: tags.cpp:27
OTest2
Definition: assertbean.h:25
OTest2::Tags::operator=
Tags & operator=(const Tags &other_)
Assignment.
Definition: tags.cpp:59
OTest2::Tags::appendTag
void appendTag(const std::string &tag_)
Append new tag.
Definition: tags.cpp:72
OTest2::Tags::~Tags
~Tags()
Dtor.
Definition: tags.cpp:50
OTest2::Tags
List of tags assigned to a testing object.
Definition: tags.h:32