Reaktoro 
A unified framework for modeling chemically reactive systems
StringList.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2015 Allan Leal
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <string>
22 #include <vector>
23 
24 namespace Reaktoro {
25 
28 {
29 public:
31  StringList();
32 
38  StringList(const char* str);
39 
46  StringList(const char* str, char token);
47 
53  StringList(std::string str);
54 
61  StringList(std::string str, char token);
62 
64  StringList(const std::vector<std::string>& strings);
65 
67  virtual ~StringList();
68 
70  auto strings() const -> const std::vector<std::string>&;
71 
72 private:
73  std::vector<std::string> _strings;
74 };
75 
77 inline auto begin(const StringList& strings) -> decltype(strings.strings().begin())
78 {
79  return strings.strings().begin();
80 }
81 
83 inline auto begin(StringList& strings) -> decltype(strings.strings().begin())
84 {
85  return strings.strings().begin();
86 }
87 
89 inline auto end(const StringList& strings) -> decltype(strings.strings().end())
90 {
91  return strings.strings().end();
92 }
93 
95 inline auto end(StringList& strings) -> decltype(strings.strings().end())
96 {
97  return strings.strings().end();
98 }
99 
100 } // namespace Reaktoro
StringList()
Construct a default StringList instance.
Definition: StringList.cpp:88
A class for representing a list of strings with special constructors.
Definition: StringList.hpp:27
auto begin(const Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().begin())
Return begin const iterator of a ReactionEquation instance.
Definition: ReactionEquation.hpp:86
auto strings() const -> const std::vector< std::string > &
Return a vector of strings.
Definition: StringList.cpp:114
virtual ~StringList()
Destroy this StringList instance.
Definition: StringList.cpp:111
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto end(const Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().end())
Return end const iterator of a ReactionEquation instance.
Definition: ReactionEquation.hpp:98