#include <cstring>
#include <iostream>
#include <stdexcept>
#include <string>
#include <zlib.h>
Go to the source code of this file.
|
| std::string const & | to_string (std::string const &s) |
| | Allows to use to_string method for elements that are already string. More...
|
| |
| template<typename... TArgs> |
| std::string | concat (TArgs const &... args) |
| | Cast and concatenate parameter pack elements as string. More...
|
| |
| unsigned int | getFields (gzFile file, char *buffer, dataFields fields) |
| | Read fields from the given resource file. More...
|
| |
◆ __DEBUG__
| #define __DEBUG__ |
( |
|
x | ) |
{ } |
◆ __DEBUG_FIELDS__
| #define __DEBUG_FIELDS__ |
( |
|
x | ) |
{ } |
◆ __HERE__
| #define __HERE__ std::string(__FILE__) + ":" + std::to_string(__LINE__) |
Macro to get the current LINE and FILE (format: FILE:LINE)
◆ __PDEBUG__
| #define __PDEBUG__ |
( |
|
x, |
|
|
|
y |
|
) |
| { } |
◆ __THROW__
| #define __THROW__ |
( |
|
x | ) |
throw std::runtime_error(std::string("[" + __HERE__ + "] " + x)); |
Macro to throw a running error, showing the current line and file (see HERE macro)
◆ GZ_BUFFER_SIZE
| #define GZ_BUFFER_SIZE 2000 |
Buffer size for gzread uses.
◆ GZ_READ_CHECK
| #define GZ_READ_CHECK |
( |
|
FILE, |
|
|
|
BUFFER, |
|
|
|
LEN |
|
) |
| |
Value:if (static_cast<int>((LEN) * sizeof(*(BUFFER))) != \
gzread((FILE), (BUFFER), (LEN) * sizeof(*(BUFFER)))) \
return (-1);
Macro to read a compressed file using gzread (zlib) that returns -1 if the read size is not the expected size.
◆ dataFields
| typedef char dataFields[10][40] |
◆ concat()
template<typename... TArgs>
| std::string concat |
( |
TArgs const &... |
args | ) |
|
Cast and concatenate parameter pack elements as string.
- Template Parameters
-
| TArgs | Types of the given elements |
- Parameters
-
| args | Elements to stringify and concatenate |
- Returns
- A single string with all the given elements
◆ getFields()
| unsigned int getFields |
( |
gzFile |
file, |
|
|
char * |
buffer, |
|
|
dataFields |
fields |
|
) |
| |
Read fields from the given resource file.
- Parameters
-
| file | resource file to read |
| buffer | Zlib reading buffer |
| fields | dataFields pointer in which fields will be written |
- Returns
- The size of read data
◆ to_string()
| std::string const& to_string |
( |
std::string const & |
s | ) |
|
|
inline |
Allows to use to_string method for elements that are already string.
- Parameters
-
- Returns
- The same String as provided