From 065e2f00472e14bc4ff98ce147fb655d7cd6146f Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 7 Jan 2019 11:08:22 +1100 Subject: [PATCH] icd: add ostream operators --- CMakeLists.txt | 2 ++ icd/fwd.hpp | 14 ++++++++++++++ icd/ostream.cpp | 22 ++++++++++++++++++++++ icd/ostream.hpp | 17 +++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 icd/ostream.cpp create mode 100644 icd/ostream.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b25e37..f56a321 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,8 @@ add_library (cruft-vk-icd STATIC ${GENERATED_PREFIX}/icd/vtable.hpp ${GENERATED_PREFIX}/icd/dispatch.cpp icd/dispatch.hpp + icd/ostream.cpp + icd/ostream.hpp icd/vendor.hpp icd/vendor.cpp icd/vendor_${VK_LOADER_VENDOR} diff --git a/icd/fwd.hpp b/icd/fwd.hpp index e69de29..703146d 100644 --- a/icd/fwd.hpp +++ b/icd/fwd.hpp @@ -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 + */ + +#pragma once + + +namespace cruft::vk::icd { + struct icd_t; +} diff --git a/icd/ostream.cpp b/icd/ostream.cpp new file mode 100644 index 0000000..b17ba16 --- /dev/null +++ b/icd/ostream.cpp @@ -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 + */ + +#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 << "'" + << " } }"; +}; diff --git a/icd/ostream.hpp b/icd/ostream.hpp new file mode 100644 index 0000000..d22156a --- /dev/null +++ b/icd/ostream.hpp @@ -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 + */ + +#pragma once + +#include "fwd.hpp" + +#include + +namespace cruft::vk::icd { + std::ostream& operator<< (std::ostream&, icd_t const&); +}