-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use std::tuple instead of std::pair for pfConsoleParser returns
- Loading branch information
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
|
||
#include "pfConsoleParser.h" | ||
|
||
#include <utility> | ||
|
||
#include "pfConsoleCmd.h" | ||
|
||
static const char kTokenSeparators[] = " =\r\n\t,"; | ||
|
@@ -117,7 +119,7 @@ std::optional<ST::string> pfConsoleTokenizer::NextArgument() | |
return begin; | ||
} | ||
|
||
std::pair<pfConsoleCmdGroup*, std::optional<ST::string>> pfConsoleParser::ParseGroupAndName() | ||
std::tuple<pfConsoleCmdGroup*, std::optional<ST::string>> pfConsoleParser::ParseGroupAndName() | ||
{ | ||
pfConsoleCmdGroup* group = pfConsoleCmdGroup::GetBaseGroup(); | ||
auto token = fTokenizer.NextNamePart(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
|
||
#include <optional> | ||
#include <string_theory/string> | ||
#include <utility> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
class pfConsoleCmd; | ||
|
@@ -91,7 +91,7 @@ class pfConsoleParser | |
// until a token is encountered that isn't a known group name. | ||
// Returns the found group and the first non-group token | ||
// (which may be an empty std::optional if the end of the line was reached). | ||
std::pair<pfConsoleCmdGroup*, std::optional<ST::string>> ParseGroupAndName(); | ||
std::tuple<pfConsoleCmdGroup*, std::optional<ST::string>> ParseGroupAndName(); | ||
|
||
// Parse the command name part of the line. | ||
// Returns the command corresponding to that name, | ||
|