2121#include " commands/users_result.h"
2222#include " commands/info_result.h"
2323#include " commands/client_result.h"
24+ #include " commands/test_result.h"
2425
2526class P4API
2627{
@@ -35,6 +36,8 @@ class P4API
3536
3637 template <class T >
3738 T Run (const char * command, const std::vector<std::string>& stringArguments);
39+ template <class T >
40+ T RunEx (const char * command, const std::vector<std::string>& stringArguments, const int commandRetries);
3841
3942public:
4043 static std::string P4PORT;
@@ -63,6 +66,7 @@ class P4API
6366
6467 void AddClientSpecView (const std::vector<std::string>& viewStrings);
6568
69+ TestResult TestConnection (const int retries);
6670 ChangesResult ShortChanges (const std::string& path);
6771 ChangesResult Changes (const std::string& path);
6872 ChangesResult Changes (const std::string& path, const std::string& from, int32_t maxCount);
@@ -84,7 +88,7 @@ class P4API
8488};
8589
8690template <class T >
87- inline T P4API::Run (const char * command, const std::vector<std::string>& stringArguments)
91+ inline T P4API::RunEx (const char * command, const std::vector<std::string>& stringArguments, const int commandRetries )
8892{
8993 std::string argsString;
9094 for (const std::string& stringArg : stringArguments)
@@ -103,7 +107,7 @@ inline T P4API::Run(const char* command, const std::vector<std::string>& stringA
103107 m_ClientAPI.SetArgv (argsCharArray.size (), argsCharArray.data ());
104108 m_ClientAPI.Run (command, &clientUser);
105109
106- int retries = CommandRetries ;
110+ int retries = commandRetries ;
107111 while (m_ClientAPI.Dropped () || clientUser.GetError ().IsError ())
108112 {
109113 if (retries == 0 )
@@ -167,3 +171,9 @@ inline T P4API::Run(const char* command, const std::vector<std::string>& stringA
167171
168172 return clientUser;
169173}
174+
175+ template <class T >
176+ inline T P4API::Run (const char * command, const std::vector<std::string>& stringArguments)
177+ {
178+ return RunEx<T>(command, stringArguments, CommandRetries);
179+ }
0 commit comments