plptools
Loading...
Searching...
No Matches
ini.h
Go to the documentation of this file.
1/*
2 * This file is part of plptools.
3 *
4 * Copyright (c) 2026 Jason Morley <hello@jbmorley.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
18 *
19 */
20#pragma once
21
22#include <memory>
23#include <string>
24#include <unordered_map>
25
26namespace ini {
27
33extern std::unique_ptr<std::unordered_map<std::string, std::string>> deserialize(const std::string contents);
34
40extern std::string serialize(const std::unordered_map<std::string, std::string> &contents);
41
42};
Definition: ini.h:26
std::string serialize(const std::unordered_map< std::string, std::string > &contents)
Outputs simple flat ini data.
Definition: ini.cc:30
std::unique_ptr< std::unordered_map< std::string, std::string > > deserialize(const std::string contents)
Simple parser for flat ini data.
Definition: ini.cc:49