#include <vector>
#include <fstream>
#include <sstream>
#include "tile.h"
#include "square.h"
#include "play.h"
#include "utils.h"
Go to the source code of this file.
◆ charPresent()
bool charPresent |
( |
string |
str, |
|
|
char |
ch |
|
) |
| |
Checks whether a char is present in a string
- Parameters
-
str | String to search in |
ch | Search target |
- Returns
- true if found, false otherwise
This function shall not throw exceptions.
Definition at line 62 of file utils.cc.
◆ log()
void log |
( |
string |
logFilePath, |
|
|
string |
str |
|
) |
| |
Log a message to a file
- Parameters
-
logFilePath | Path to the file to write to |
str | Log message |
- Exceptions
-
std::string | containing the error message |
Definition at line 104 of file utils.cc.
◆ parsePlay()
std::vector<std::string> parsePlay |
( |
std::string |
in | ) |
|
Parses a Play in the format <tiles>-<row>-<column>-<direction>
- Parameters
-
- Returns
- Parsed components
This function shall not throw exceptions.
Definition at line 78 of file utils.cc.
◆ RawTimeToString()
string RawTimeToString |
( |
const time_t & |
t | ) |
|
Converts a time_t to a std::string
- Parameters
-
- Returns
- Converted time_t
This function shall not throw exceptions.
Definition at line 127 of file utils.cc.
◆ squarePresent()
bool squarePresent |
( |
std::vector< Square * > |
s, |
|
|
Square * |
target |
|
) |
| |
Checks whether a Square* is present in a vector<Square*>
- Parameters
-
s | Vector to search in |
target | Search target |
- Returns
- true if found, false otherwise
This function shall not throw exceptions.
Definition at line 24 of file utils.cc.
◆ tilePresent()
bool tilePresent |
( |
std::vector< Tile * > |
t, |
|
|
Tile * |
target |
|
) |
| |
Checks whether a Tile* is present in a vector<Tile*>
- Parameters
-
t | Vector to search in |
target | Search target |
- Returns
- true if found, false otherwise
This function shall not throw exceptions.
Definition at line 43 of file utils.cc.