Reaktoro  v2.6.0
A unified framework for modeling chemically reactive systems
PhreeqcDatabase.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright © 2014-2022 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // Reaktoro includes
21 #include <Reaktoro/Core/Database.hpp>
22 
23 namespace Reaktoro {
24 
26 class PhreeqcDatabase : public Database
27 {
28 public:
31 
45  PhreeqcDatabase(const String& name);
46 
51  auto load(const String& database) -> PhreeqcDatabase&;
52 
66  static auto withName(const String& name) -> PhreeqcDatabase;
67 
71  static auto fromFile(const String& path) -> PhreeqcDatabase;
72 
75  static auto fromContents(const String& contents) -> PhreeqcDatabase;
76 
80  static auto contents(const String& name) -> String;
81 
83  static auto namesEmbeddedDatabases() -> Strings;
84 };
85 
86 } // namespace Reaktoro
The class used to store and retrieve data of chemical species.
Definition: Database.hpp:32
The class used to store and retrieve data of chemical species from PHREEQC databases.
Definition: PhreeqcDatabase.hpp:27
auto load(const String &database) -> PhreeqcDatabase &
Extend this PhreeqcDatabase object with contents in given database file.
static auto contents(const String &name) -> String
Return the contents of an embedded PHREEQC database as a string.
PhreeqcDatabase()
Construct a default PhreeqcDatabase object.
static auto fromContents(const String &contents) -> PhreeqcDatabase
Return a PhreeqcDatabase object constructed with given database text contents.
static auto withName(const String &name) -> PhreeqcDatabase
Return a PhreeqcDatabase object constructed with an embedded database file.
static auto fromFile(const String &path) -> PhreeqcDatabase
Return a PhreeqcDatabase object constructed with a given local file.
static auto namesEmbeddedDatabases() -> Strings
Return the names of the currently supported embedded PHREEQC databases.
PhreeqcDatabase(const String &name)
Construct a PhreeqcDatabase object using an embedded PHREEQC database.
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:28
std::string String
Convenient alias for std::string.
Definition: Types.hpp:52
std::vector< std::string > Strings
Convenient alias for std::vector<String>.
Definition: Types.hpp:55