From b54580dd0c0bc0dababd64d35145e5518a998c7e Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 10 Sep 2025 18:26:38 +0300 Subject: [PATCH 1/3] Initial commit with task details for issue #99 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/Interfaces/issues/99 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..fab41c6 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/Interfaces/issues/99 +Your prepared branch: issue-99-0c25b77b +Your prepared working directory: /tmp/gh-issue-solver-1757517995121 + +Proceed. \ No newline at end of file From 6b86bc40eda150f971ba1c0eac6a6cfd9df87128 Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 10 Sep 2025 18:26:55 +0300 Subject: [PATCH 2/3] Remove CLAUDE.md - PR created successfully --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index fab41c6..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/Interfaces/issues/99 -Your prepared branch: issue-99-0c25b77b -Your prepared working directory: /tmp/gh-issue-solver-1757517995121 - -Proceed. \ No newline at end of file From fe132ec695a0ddf0416bfdc7db431b373d618a9d Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 10 Sep 2025 18:30:55 +0300 Subject: [PATCH 3/3] Translate ICli interface from C# to C++ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ICli interface following project patterns and conventions - Add CCli concept for compile-time interface verification - Update main Platform.Interfaces.h to include new interface and concept - Add comprehensive unit test for the CLI interface and concept - Preserve bilingual documentation (English and Russian) - Use std::vector for command arguments to replace C# params string[] πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../Platform.Interfaces.Tests.cpp | 13 +++++++++ cpp/Platform.Interfaces/CCli.h | 12 ++++++++ cpp/Platform.Interfaces/ICli.h | 28 +++++++++++++++++++ cpp/Platform.Interfaces/Platform.Interfaces.h | 2 ++ 4 files changed, 55 insertions(+) create mode 100644 cpp/Platform.Interfaces/CCli.h create mode 100644 cpp/Platform.Interfaces/ICli.h diff --git a/cpp/Platform.Interfaces.Tests/Platform.Interfaces.Tests.cpp b/cpp/Platform.Interfaces.Tests/Platform.Interfaces.Tests.cpp index c59ac91..e94e7fd 100644 --- a/cpp/Platform.Interfaces.Tests/Platform.Interfaces.Tests.cpp +++ b/cpp/Platform.Interfaces.Tests/Platform.Interfaces.Tests.cpp @@ -140,4 +140,17 @@ namespace Platform::Interfaces::Tests { ASSERT_TRUE((CSetter)); } } + + TEST(CompileTests, Cli) { + struct EmptyCli : public ICli { + int Run(const std::vector& args) override { return 0; } + }; + static_assert(CCli); + + { + CCli auto cli = EmptyCli{}; + + ASSERT_TRUE((CCli)); + } + } } // namespace Platform::Interfaces::Tests diff --git a/cpp/Platform.Interfaces/CCli.h b/cpp/Platform.Interfaces/CCli.h new file mode 100644 index 0000000..2843a8c --- /dev/null +++ b/cpp/Platform.Interfaces/CCli.h @@ -0,0 +1,12 @@ +ο»Ώ#pragma once + +#include +#include +#include + +namespace Platform::Interfaces { + template + concept CCli = requires(TSelf self, const std::vector& args) { + { self.Run(args) } -> std::same_as; + }; +} // namespace Platform::Interfaces \ No newline at end of file diff --git a/cpp/Platform.Interfaces/ICli.h b/cpp/Platform.Interfaces/ICli.h new file mode 100644 index 0000000..86edc18 --- /dev/null +++ b/cpp/Platform.Interfaces/ICli.h @@ -0,0 +1,28 @@ +ο»Ώ#pragma once + +#include +#include + +namespace Platform::Interfaces { + /// + /// Defines command line interfaces for command that interacts with an operating system. + /// ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚ интСрфСйс ΠΊΠΎΠΌΠ°Π½Π΄Π½ΠΎΠΉ строки, для ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹ Π²Π·Π°ΠΈΠΌΠΎΠ΄Π΅ΠΉΡΡ‚Π²ΡƒΡŽΡ‰Π΅ΠΉ с ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΎΠ½Π½ΠΎΠΉ систСмой. + /// + struct ICli { + /// + /// Runs a command. + /// ЗапускаСт ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ. + /// + /// + /// Arguments for a command. + /// АргумСнты для ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹. + /// + /// + /// Returns command's exit code. + /// Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ ΠΊΠΎΠ΄ Π²Ρ‹Ρ…ΠΎΠ΄Π° ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹. + /// + virtual int Run(const std::vector& args) = 0; + + virtual ~ICli() = default; + }; +} // namespace Platform::Interfaces \ No newline at end of file diff --git a/cpp/Platform.Interfaces/Platform.Interfaces.h b/cpp/Platform.Interfaces/Platform.Interfaces.h index e6cbd2f..b50bdd3 100644 --- a/cpp/Platform.Interfaces/Platform.Interfaces.h +++ b/cpp/Platform.Interfaces/Platform.Interfaces.h @@ -14,6 +14,7 @@ #include "CProvider.h" #include "CSetter.h" #include "CProperty.h" +#include "CCli.h" #include "ICounter[TResult, TArgument].h" #include "ICounter[TResult].h" @@ -25,6 +26,7 @@ #include "IProvider[TProvided].h" #include "ISetter[TValue, TArgument].h" #include "ISetter[TValue].h" +#include "ICli.h" #include "Polymorph.h"