Skip to content

Commit

Permalink
rename to special/standard
Browse files Browse the repository at this point in the history
  • Loading branch information
PankajBhojwani committed Apr 27, 2024
1 parent ae16a5e commit dc874c3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/cascadia/TerminalSettingsModel/ActionMapSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// { "name": "Custom Copy", "command": "copy", "keys": "ctrl+c" }
// { "command": "copy", "keys": "ctrl+shift+c" }
// { "command": "copy", "keys": "ctrl+ins" }
auto toJson = [&actionList](const Model::Command& cmd) {
auto toJsonSpecial = [&actionList](const Model::Command& cmd) {
const auto cmdImpl{ winrt::get_self<implementation::Command>(cmd) };
const auto& cmdJsonArray{ cmdImpl->ToJson() };
const auto& cmdJsonArray{ cmdImpl->ToJsonSpecial() };
for (const auto& cmdJson : cmdJsonArray)
{
actionList.append(cmdJson);
}
};

auto toJson2 = [&actionList](const Model::Command& cmd) {
auto toJsonStandard = [&actionList](const Model::Command& cmd) {
const auto cmdImpl{ winrt::get_self<implementation::Command>(cmd) };
const auto& cmdJsonArray{ cmdImpl->ToJson2() };
const auto& cmdJsonArray{ cmdImpl->ToJsonStandard() };
for (const auto& cmdJson : cmdJsonArray)
{
actionList.append(cmdJson);
Expand All @@ -119,19 +119,19 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation

for (const auto& [_, cmd] : _ActionMap)
{
toJson2(cmd);
toJsonStandard(cmd);
}

// Serialize all nested Command objects added in the current layer
for (const auto& [_, cmd] : _NestedCommands)
{
toJson(cmd);
toJsonSpecial(cmd);
}

// Serialize all iterable Command objects added in the current layer
for (const auto& cmd : _IterableCommands)
{
toJson(cmd);
toJsonSpecial(cmd);
}

return actionList;
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalSettingsModel/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// - <none>
// Return Value:
// - an array of serialized actions
Json::Value Command::ToJson() const
Json::Value Command::ToJsonSpecial() const
{
Json::Value cmdList{ Json::ValueType::arrayValue };

Expand Down Expand Up @@ -506,7 +506,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// - <none>
// Return Value:
// - an array of serialized actions
Json::Value Command::ToJson2() const
Json::Value Command::ToJsonStandard() const
{
Json::Value cmdList{ Json::ValueType::arrayValue };

Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalSettingsModel/Command.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
static std::vector<SettingsLoadWarnings> LayerJson(Windows::Foundation::Collections::IMap<winrt::hstring, Model::Command>& commands,
const Json::Value& json,
const OriginTag origin);
Json::Value ToJson() const;
Json::Value ToJson2() const;
Json::Value ToJsonSpecial() const;
Json::Value ToJsonStandard() const;

bool HasNestedCommands() const;
bool IsNestedCommand() const noexcept;
Expand Down

0 comments on commit dc874c3

Please sign in to comment.