rename methods

This commit is contained in:
Arthur Passos 2022-12-05 14:00:30 -03:00
parent e6b97c4f85
commit 08c33f4766
5 changed files with 21 additions and 21 deletions

View File

@ -56,7 +56,7 @@ NextState LazyEscapingKeyValuePairExtractor::extract(const std::string & file, s
NextState LazyEscapingKeyValuePairExtractor::waitKey(const std::string & file, size_t pos) const {
return key_state_handler.waitKey(file, pos);
return key_state_handler.wait(file, pos);
}
NextState LazyEscapingKeyValuePairExtractor::readKeyValueDelimiter(const std::string &file, size_t pos) const {
@ -64,7 +64,7 @@ NextState LazyEscapingKeyValuePairExtractor::readKeyValueDelimiter(const std::st
}
NextState LazyEscapingKeyValuePairExtractor::readKey(const std::string & file, size_t pos) {
auto [next_state, next_key] = key_state_handler.readKey(file, pos);
auto [next_state, next_key] = key_state_handler.read(file, pos);
key = next_key;
@ -72,7 +72,7 @@ NextState LazyEscapingKeyValuePairExtractor::readKey(const std::string & file, s
}
NextState LazyEscapingKeyValuePairExtractor::readEnclosedKey(const std::string &file, size_t pos) {
auto [next_state, next_key] = key_state_handler.readEnclosedKey(file, pos);
auto [next_state, next_key] = key_state_handler.readEnclosed(file, pos);
key = next_key;
@ -80,11 +80,11 @@ NextState LazyEscapingKeyValuePairExtractor::readEnclosedKey(const std::string &
}
NextState LazyEscapingKeyValuePairExtractor::waitValue(const std::string &file, size_t pos) const {
return value_state_handler.waitValue(file, pos);
return value_state_handler.wait(file, pos);
}
NextState LazyEscapingKeyValuePairExtractor::readValue(const std::string &file, size_t pos) {
auto [next_state, next_value] = value_state_handler.readValue(file, pos);
auto [next_state, next_value] = value_state_handler.read(file, pos);
value = next_value;
@ -92,7 +92,7 @@ NextState LazyEscapingKeyValuePairExtractor::readValue(const std::string &file,
}
NextState LazyEscapingKeyValuePairExtractor::readEnclosedValue(const std::string &file, size_t pos) {
auto [next_state, next_value] = value_state_handler.readEnclosedValue(file, pos);
auto [next_state, next_value] = value_state_handler.readEnclosed(file, pos);
value = next_value;
@ -100,7 +100,7 @@ NextState LazyEscapingKeyValuePairExtractor::readEnclosedValue(const std::string
}
NextState LazyEscapingKeyValuePairExtractor::readEmptyValue(const std::string &file, size_t pos) {
auto [next_state, next_value] = value_state_handler.readEmptyValue(file, pos);
auto [next_state, next_value] = value_state_handler.readEmpty(file, pos);
value = next_value;

View File

@ -8,7 +8,7 @@ KeyStateHandler::KeyStateHandler(char key_value_delimiter_, char escape_characte
: StateHandler(escape_character_, enclosing_character_), key_value_delimiter(key_value_delimiter_)
{}
NextState KeyStateHandler::waitKey(const std::string &file, size_t pos) const {
NextState KeyStateHandler::wait(const std::string &file, size_t pos) const {
while (pos < file.size()) {
const auto current_character = file[pos];
if (isalpha(current_character)) {
@ -32,7 +32,7 @@ NextState KeyStateHandler::waitKey(const std::string &file, size_t pos) const {
};
}
NextStateWithElement KeyStateHandler::readKey(const std::string &file, size_t pos) const {
NextStateWithElement KeyStateHandler::read(const std::string &file, size_t pos) const {
bool escape = false;
auto start_index = pos;
@ -73,7 +73,7 @@ NextStateWithElement KeyStateHandler::readKey(const std::string &file, size_t po
};
}
NextStateWithElement KeyStateHandler::readEnclosedKey(const std::string &file, size_t pos) const {
NextStateWithElement KeyStateHandler::readEnclosed(const std::string &file, size_t pos) const {
auto start_index = pos;
while (pos < file.size()) {

View File

@ -13,9 +13,9 @@ class KeyStateHandler : StateHandler {
public:
KeyStateHandler(char key_value_delimiter, char escape_character, std::optional<char> enclosing_character);
[[nodiscard]] NextState waitKey(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readKey(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readEnclosedKey(const std::string &file, size_t pos) const;
[[nodiscard]] NextState wait(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement read(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readEnclosed(const std::string &file, size_t pos) const;
[[nodiscard]] NextState readKeyValueDelimiter(const std::string & file, size_t pos) const;
private:

View File

@ -10,7 +10,7 @@ ValueStateHandler::ValueStateHandler(char escape_character_, char item_delimiter
special_character_allowlist(std::move(special_character_allowlist_))
{}
NextState ValueStateHandler::waitValue(const std::string &file, size_t pos) const {
NextState ValueStateHandler::wait(const std::string &file, size_t pos) const {
while (pos < file.size()) {
const auto current_character = file[pos];
@ -40,7 +40,7 @@ NextState ValueStateHandler::waitValue(const std::string &file, size_t pos) cons
};
}
NextStateWithElement ValueStateHandler::readValue(const std::string &file, size_t pos) const {
NextStateWithElement ValueStateHandler::read(const std::string &file, size_t pos) const {
bool escape = false;
auto start_index = pos;
@ -73,7 +73,7 @@ NextStateWithElement ValueStateHandler::readValue(const std::string &file, size_
};
}
NextStateWithElement ValueStateHandler::readEnclosedValue(const std::string &file, size_t pos) const {
NextStateWithElement ValueStateHandler::readEnclosed(const std::string &file, size_t pos) const {
auto start_index = pos;
while (pos < file.size()) {
@ -100,7 +100,7 @@ NextStateWithElement ValueStateHandler::readEnclosedValue(const std::string &fil
};
}
NextStateWithElement ValueStateHandler::readEmptyValue(const std::string &, size_t pos) const {
NextStateWithElement ValueStateHandler::readEmpty(const std::string &, size_t pos) const {
return {
{
pos + 1,

View File

@ -15,10 +15,10 @@ public:
ValueStateHandler(char escape_character, char item_delimiter,
std::optional<char> enclosing_character, std::unordered_set<char> special_character_allowlist_);
[[nodiscard]] NextState waitValue(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readValue(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readEnclosedValue(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readEmptyValue(const std::string & file, size_t pos) const;
[[nodiscard]] NextState wait(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement read(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readEnclosed(const std::string & file, size_t pos) const;
[[nodiscard]] NextStateWithElement readEmpty(const std::string & file, size_t pos) const;
private:
const char item_delimiter;