From 384c4546f172f8a0615036be9555774de6592fbc Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Thu, 24 Nov 2016 16:45:17 +0100 Subject: interface: move searchForSubstring out of Error class into a separate file --- test/libsolidity/ErrorCheck.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/libsolidity/ErrorCheck.cpp (limited to 'test/libsolidity/ErrorCheck.cpp') diff --git a/test/libsolidity/ErrorCheck.cpp b/test/libsolidity/ErrorCheck.cpp new file mode 100644 index 00000000..6dddda70 --- /dev/null +++ b/test/libsolidity/ErrorCheck.cpp @@ -0,0 +1,32 @@ +/* + This file is part of solidity. + + solidity is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + solidity is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with solidity. If not, see . +*/ +/** @file ErrorCheck.cpp + * @author Yoichi Hirai + * @date 2016 + */ + +#include +#include + +#include + +bool dev::solidity::searchErrorMessage(Error const& _err, std::string const& _substr) +{ + if (const std::string* errorMessage = boost::get_error_info(_err)) + return errorMessage->find(_substr) != std::string::npos; + return _substr.empty(); +} -- cgit