From 72c46bdd7f5d430ab1ad1d420ed77c7f22df857a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 30 Sep 2017 15:01:35 +0200 Subject: rename --- Tobii EyeX/include/eyex-cpp/APIException.hpp | 83 ---------------------------- 1 file changed, 83 deletions(-) delete mode 100755 Tobii EyeX/include/eyex-cpp/APIException.hpp (limited to 'Tobii EyeX/include/eyex-cpp/APIException.hpp') diff --git a/Tobii EyeX/include/eyex-cpp/APIException.hpp b/Tobii EyeX/include/eyex-cpp/APIException.hpp deleted file mode 100755 index d270c04..0000000 --- a/Tobii EyeX/include/eyex-cpp/APIException.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/********************************************************************************************************************* - * Copyright 2013-2014 Tobii Technology AB. All rights reserved. - * APIException.hpp - *********************************************************************************************************************/ - -#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_APIEXCEPTION__HPP__) -#define __TOBII_TX_CLIENT_CPPBINDINGS_APIEXCEPTION__HPP__ - -/*********************************************************************************************************************/ - -TX_NAMESPACE_BEGIN - -/*********************************************************************************************************************/ - -class APIException -{ -public: - APIException(TX_RESULT result, const std::string& message = "") - : _result(result), _message(message) - { } - - TX_RESULT GetResult() const - { - return _result; - } - - std::string GetMessage() const - { - return _message; - } - -private: - TX_RESULT _result; - std::string _message; -}; - -/*********************************************************************************************************************/ - -inline bool TX_VALIDATE(TX_RESULT result) -{ - if(result == TX_RESULT_OK) - return true; - - throw EyeX::APIException(result, "Error"); -} - -/*********************************************************************************************************************/ - -inline bool TX_VALIDATE(TX_RESULT result, TX_RESULT falseResult) -{ - if(result == falseResult) - return false; - - return TX_VALIDATE(result); -} - -/*********************************************************************************************************************/ - -inline bool TX_VALIDATE(TX_RESULT result, TX_RESULT falseResult1, TX_RESULT falseResult2) -{ - if(result == falseResult2) - return false; - - return TX_VALIDATE(result, falseResult1); -} - -template -inline std::string GetString(TX_RESULT (*pFn)(THandle1, TX_STRING, TX_SIZE*), THandle2 handle, TX_SIZE estimatedLength = 0) -{ - std::string str; - TX_VALIDATE(GetString(&str, pFn, handle, estimatedLength)); - return str; -} - -/*********************************************************************************************************************/ - -TX_NAMESPACE_END - -/*********************************************************************************************************************/ - -#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_APIEXCEPTION__HPP__) - -/*********************************************************************************************************************/ -- cgit v1.2.3