30 lines
659 B
C++
30 lines
659 B
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Utils
|
|
{
|
|
bool isWhitespaceCharacter(char const c);
|
|
|
|
// Returns nullopt in case the value is missing its terminator character
|
|
std::optional<std::string> getValueSurroundedBy(
|
|
std::string const & src,
|
|
std::size_t const pos,
|
|
char const surroundingCharacter);
|
|
|
|
std::string getValueSurroundedByWhitespace(
|
|
std::string const & src,
|
|
std::size_t const pos);
|
|
|
|
namespace Bytes
|
|
{
|
|
void Write(
|
|
int const value,
|
|
std::vector<std::uint8_t> & vec,
|
|
std::size_t const pos);
|
|
|
|
int Read(std::vector<std::uint8_t> const & vec, std::size_t const pos);
|
|
}
|
|
} |