AnselmoGPP / IO_library

Compilation of parsing and I/O functions used frequently

Repository from Github https://github.comAnselmoGPP/IO_libraryRepository from Github https://github.comAnselmoGPP/IO_library

iolib

Simple library with useful functions for I/O operations and parsing.

  • Parsing functions:
// Given a string (text), extract all the substrings that exist between certain tokens (tokens) (one char size or bigger)
std::vector<std::string> extract_tok_XL(std::string &text, const std::string *tokens, int num_tokens, bool sort_tokens);
// Given a string, extract all the substrings that exist between certain token (one char size or bigger)
std::vector<std::string> extract_tok_X(std::string &text, const std::string *tokens);
// Given a string, extract all the substrings that exist between certain token (one char size)
std::vector<std::string> extract_tok(std::string &text, char token);
// Given a number, extract its digits and return them in a vector
std::vector<unsigned int> extract_digits(unsigned int n);
  • I/O functions:
// Extract all the data from a file to a string
std::string extract_file(std::string &text);
// Extract all the data from a file to a vector<string>, where each string is a line (\n)
std::string extract_file_lines(std::string &text);
// Returns a string containing the name of the current directory
std::string getCurrentDirectory();

Links:

About

Compilation of parsing and I/O functions used frequently


Languages

Language:C++ 99.3%Language:CMake 0.7%