mirror of
https://github.com/KhronosGroup/Vulkan-Hpp
synced 2024-11-08 13:40:08 +00:00
Introduce helper function toHexString used in to_string functions on invalid values.
This commit is contained in:
parent
65b7cdd5e3
commit
244a096d77
@ -2196,6 +2196,16 @@ void VulkanHppGenerator::appendEnum( std::string & str, std::pair<std::string, E
|
||||
|
||||
void VulkanHppGenerator::appendEnums( std::string & str ) const
|
||||
{
|
||||
// start with toHexString, which is used in all the to_string functions here!
|
||||
str += R"(
|
||||
VULKAN_HPP_INLINE std::string toHexString( uint32_t value )
|
||||
{
|
||||
std::stringstream stream;
|
||||
stream << std::hex << value;
|
||||
return stream.str();
|
||||
}
|
||||
)";
|
||||
|
||||
for ( auto const & e : m_enums )
|
||||
{
|
||||
std::string enter, leave;
|
||||
@ -2271,7 +2281,7 @@ void VulkanHppGenerator::appendEnumToString( std::string &
|
||||
str += " case " + enumName + "::" + value.vkValue + " : return \"" + value.vkValue.substr( 1 ) + "\";\n";
|
||||
}
|
||||
str +=
|
||||
" default: return \"invalid\";\n"
|
||||
" default: return \"invalid ( \" + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + \" )\";\n"
|
||||
" }\n";
|
||||
}
|
||||
|
||||
@ -10741,6 +10751,7 @@ int main( int argc, char ** argv )
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <system_error>
|
||||
#include <tuple>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user