// Copyright (c) 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "source/util/parse_number.h" #include <functional> #include <iomanip> #include <memory> #include <sstream> #include <string> #include <tuple> #include "source/util/hex_float.h" #include "source/util/make_unique.h" namespace spvtools { namespace utils { namespace { // A helper class that temporarily stores error messages and dump the messages // to a string which given as as pointer when it is destructed. If the given // pointer is a nullptr, this class does not store error message. class ErrorMsgStream { … }; } // namespace EncodeNumberStatus ParseAndEncodeIntegerNumber( const char* text, const NumberType& type, std::function<void(uint32_t)> emit, std::string* error_msg) { … } EncodeNumberStatus ParseAndEncodeFloatingPointNumber( const char* text, const NumberType& type, std::function<void(uint32_t)> emit, std::string* error_msg) { … } EncodeNumberStatus ParseAndEncodeNumber(const char* text, const NumberType& type, std::function<void(uint32_t)> emit, std::string* error_msg) { … } } // namespace utils } // namespace spvtools