Skip to content

Commit

Permalink
Use std::tuple instead of std::pair for pfConsoleParser returns
Browse files Browse the repository at this point in the history
  • Loading branch information
dgelessus committed Sep 16, 2023
1 parent 9d5e3a1 commit 1ccefa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,";
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1ccefa3

Please sign in to comment.