From 9ac2ac14c1819be2341c6947245bf63b02795528 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 13 Jul 2017 21:06:04 +0200 Subject: Rename read file callback. --- solc/CommandLineInterface.cpp | 14 +++++++------- solc/jsonCompiler.cpp | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'solc') diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index bfc53aef..315f951e 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -663,7 +663,7 @@ Allowed options)", bool CommandLineInterface::processInput() { - ReadFile::Callback fileReader = [this](string const& _path) + ReadCallback::Callback fileReader = [this](string const& _path) { try { @@ -683,25 +683,25 @@ bool CommandLineInterface::processInput() } } if (!isAllowed) - return ReadFile::Result{false, "File outside of allowed directories."}; + return ReadCallback::Result{false, "File outside of allowed directories."}; else if (!boost::filesystem::exists(path)) - return ReadFile::Result{false, "File not found."}; + return ReadCallback::Result{false, "File not found."}; else if (!boost::filesystem::is_regular_file(canonicalPath)) - return ReadFile::Result{false, "Not a valid file."}; + return ReadCallback::Result{false, "Not a valid file."}; else { auto contents = dev::contentsString(canonicalPath.string()); m_sourceCodes[path.string()] = contents; - return ReadFile::Result{true, contents}; + return ReadCallback::Result{true, contents}; } } catch (Exception const& _exception) { - return ReadFile::Result{false, "Exception in read callback: " + boost::diagnostic_information(_exception)}; + return ReadCallback::Result{false, "Exception in read callback: " + boost::diagnostic_information(_exception)}; } catch (...) { - return ReadFile::Result{false, "Unknown exception in read callback."}; + return ReadCallback::Result{false, "Unknown exception in read callback."}; } }; diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp index ab928ac0..684d49e4 100644 --- a/solc/jsonCompiler.cpp +++ b/solc/jsonCompiler.cpp @@ -41,9 +41,9 @@ typedef void (*CStyleReadFileCallback)(char const* _path, char** o_contents, cha namespace { -ReadFile::Callback wrapReadCallback(CStyleReadFileCallback _readCallback = nullptr) +ReadCallback::Callback wrapReadCallback(CStyleReadFileCallback _readCallback = nullptr) { - ReadFile::Callback readCallback; + ReadCallback::Callback readCallback; if (_readCallback) { readCallback = [=](string const& _path) @@ -51,23 +51,23 @@ ReadFile::Callback wrapReadCallback(CStyleReadFileCallback _readCallback = nullp char* contents_c = nullptr; char* error_c = nullptr; _readCallback(_path.c_str(), &contents_c, &error_c); - ReadFile::Result result; + ReadCallback::Result result; result.success = true; if (!contents_c && !error_c) { result.success = false; - result.contentsOrErrorMessage = "File not found."; + result.responseOrErrorMessage = "File not found."; } if (contents_c) { result.success = true; - result.contentsOrErrorMessage = string(contents_c); + result.responseOrErrorMessage = string(contents_c); free(contents_c); } if (error_c) { result.success = false; - result.contentsOrErrorMessage = string(error_c); + result.responseOrErrorMessage = string(error_c); free(error_c); } return result; -- cgit