icd: add ostream operators

This commit is contained in:
Danny Robson 2019-01-07 11:08:22 +11:00
parent 833d82f818
commit 065e2f0047
4 changed files with 55 additions and 0 deletions

View File

@ -66,6 +66,8 @@ add_library (cruft-vk-icd STATIC
${GENERATED_PREFIX}/icd/vtable.hpp ${GENERATED_PREFIX}/icd/vtable.hpp
${GENERATED_PREFIX}/icd/dispatch.cpp ${GENERATED_PREFIX}/icd/dispatch.cpp
icd/dispatch.hpp icd/dispatch.hpp
icd/ostream.cpp
icd/ostream.hpp
icd/vendor.hpp icd/vendor.hpp
icd/vendor.cpp icd/vendor.cpp
icd/vendor_${VK_LOADER_VENDOR} icd/vendor_${VK_LOADER_VENDOR}

View File

@ -0,0 +1,14 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2019 Danny Robson <danny@nerdcruft.net>
*/
#pragma once
namespace cruft::vk::icd {
struct icd_t;
}

22
icd/ostream.cpp Normal file
View File

@ -0,0 +1,22 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2019 Danny Robson <danny@nerdcruft.net>
*/
#include "ostream.hpp"
#include "vendor.hpp"
///////////////////////////////////////////////////////////////////////////////
std::ostream&
cruft::vk::icd::operator<< (std::ostream &os, icd_t const &value)
{
return os << "{ file_format_version: '" << value.file_format_version << "'"
<< ", icd: { library_path: '" << value.icd.library_path << "'"
<< ", api_version: '" << value.icd.api_version << "'"
<< " } }";
};

17
icd/ostream.hpp Normal file
View File

@ -0,0 +1,17 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2019 Danny Robson <danny@nerdcruft.net>
*/
#pragma once
#include "fwd.hpp"
#include <iosfwd>
namespace cruft::vk::icd {
std::ostream& operator<< (std::ostream&, icd_t const&);
}