Skip to content

Commit

Permalink
[#2] Started writing an INI class
Browse files Browse the repository at this point in the history
Signed-off-by: Clovis Durand <cd.clovel19@gmail.com>
  • Loading branch information
Clovel committed Mar 2, 2020
1 parent 6927419 commit cb94dca
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions generator/src/INI.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* @brief INI file class
*
* @file INI.hpp
*/

#ifndef INI_HPP
#define INI_HPP

/* Includes -------------------------------------------- */
#include <string>
#include <fstream>
#include <map>
#include <vector>

/* Defines --------------------------------------------- */

/* Type definitions ------------------------------------ */

/* Forzqrd declarations -------------------------------- */

/* EDS class ------------------------------------------- */
class INI {
public:
INI();

virtual ~INI();

/* Getters */
std::string fileName(void) const;

std::string getValue(const std::string &pSection,
const std::string &pEntry) const;

std::vector<std::string> getEntries(void) const;
std::vector<std::string> getSections(void) const;

/* Setters */
int setFile(const std::string &pFileName);

/* Parser */
int parseEDSFile(const std::string &pFile);
protected:
std::string mFileName;
std::fstream mFileStream;

std::map<std::string, std::map<std::string, std::string>> mConstents;

std::map<std::string, std::string> mValues;
std::vector<std::string> mSections;
std::map<std::string, std::vector<std::string> *> mFields;

private:
};

#endif /* INI_HPP */

0 comments on commit cb94dca

Please sign in to comment.