> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/inifile_8h_source.md).

# inifile.h

[Go to the documentation of this file.](/adk-5.0-programmers-guide/readme/files/dir_a221c7c7a3d266b8aa1c13ced02d08a5/dir_1084a09caae2cca43d02da13ecc9a141/dir_8b8eef682edb37a46c9343899b359ed7/inifile_8h.md)

```cpp
 1 #pragma once
 2 
 3 #include "dllspec.h"
 4 #include <map>
 5 #include <vector>
 6 #include <string>
 7 
 8 #ifndef DOXYGEN
 9 
 10 namespace vfisysinfo
 11 {
 12 #endif
 13 
 15 class IniFile
 16 {
 17  std::string filename;
 18  std::map<std::string,std::string> config;
 19  int error_line;
 20 
 21  public:
 22  std::vector<std::string> section_names;
 23  enum Mode { READONLY, READWRITE, WRITEONLY };
 24 
 28  SYS_INFO_API IniFile(const std::string &filename_, Mode mode );
 29 
 33  SYS_INFO_API IniFile( const std::string & content );
 34 
 39  SYS_INFO_API IniFile(const std::string &filename_, const std::string &content, Mode mode=READWRITE);
 40 
 45  SYS_INFO_API std::string operator()(const std::string &section) const;
 46 
 53  SYS_INFO_API std::string operator()(const std::string &section,const std::string &var, const std::string &defaultvalue="") const;
 54 
 59  SYS_INFO_API void get_section(const std::string &section, std::map<std::string,std::string> &values);
 60 
 65  SYS_INFO_API void remove(const std::string &section, const std::string &var);
 66 
 72  SYS_INFO_API void set(const std::string &section, const std::string &var, const std::string &value);
 73 
 77  SYS_INFO_API bool write() const;
 78 
 81  SYS_INFO_API int error() const { return error_line; }
 82 
 84  SYS_INFO_API void clear() { config.clear(); error_line=0; }
 85 
 86  std::string getstring(
 87  std::map<std::string,std::string> & values,
 88  const std::string & id,
 89  const std::string & alternative = "" );
 90 };
 91 
 92 #ifndef DOXYGEN
 93 } // namespace vfisysinfo
 94 #endif
 95 
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/inifile_8h_source.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
