https://github.com/antal0x11/csvlib
A very simple csv library.
https://github.com/antal0x11/csvlib
Last synced: 3 months ago
JSON representation
A very simple csv library.
- Host: GitHub
- URL: https://github.com/antal0x11/csvlib
- Owner: antal0x11
- License: mit
- Created: 2024-04-09T13:40:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-09T16:04:09.000Z (about 1 year ago)
- Last Synced: 2025-01-06T00:43:20.148Z (5 months ago)
- Language: C++
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## csvlib
A very simple csv library to read and write csv files.### Instructions
The struct that is about to be written or read, it has to implement:
- std::string to_string(const std::string &delimeter) const
- static Example init(const std::vector &_t)just like in the example.
```c++
struct Example {
int a;
int b;Example (int a, int b) : a(a), b(b) {}
std::string to_string(const std::string &delimeter) const
{
std::ostringstream _s;
_s << a << delimeter << b;
return _s.str();
}static Example init(const std::vector &_t)
{
return Example(std::stoi(_t[0]), std::stoi(_t[1]));
}
}```