header_txt.append('#include <string>')
header_txt.append('#include <string.h>')
header_txt.append('')
+ header_txt.append('#include "vk_loader_platform.h"')
+ header_txt.append('#include "vk_layer.h"')
+ header_txt.append('#include "vk_struct_string_helper_cpp.h"')
+ header_txt.append('#include "vk_layer_table.h"')
+ header_txt.append('#include "vk_layer_extension_utils.h"')
+ header_txt.append('#include <unordered_map>')
+ header_txt.append('')
header_txt.append('static std::ofstream fileStream;')
header_txt.append('static std::string fileName = "vk_apidump.txt";')
header_txt.append('std::ostream* outputStream = NULL;')
header_txt.append(' if(writeToFile)')
header_txt.append(' {')
header_txt.append(' fileStream.open(fileName);')
- header_txt.append(' outputStream = &fileStream;')
+ header_txt.append(' if ((fileStream.rdstate() & fileStream.failbit) != 0) {')
+ header_txt.append(' outputStream = &std::cout;')
+ header_txt.append(' (*outputStream) << endl << "APIDump ERROR: Bad output filename specified: " << fileName << ". Writing to STDOUT instead" << endl << endl;')
+ header_txt.append(' }')
+ header_txt.append(' else')
+ header_txt.append(' outputStream = &fileStream;')
header_txt.append(' }')
header_txt.append(' else')
header_txt.append(' {')
header_txt.append('}')
header_txt.append('')
header_txt.append('%s' % self.lineinfo.get())
- header_txt.append('#include "vk_loader_platform.h"')
- header_txt.append('#include "vk_layer.h"')
- header_txt.append('#include "vk_struct_string_helper_cpp.h"')
- header_txt.append('#include "vk_layer_table.h"')
- header_txt.append('#include "vk_layer_extension_utils.h"')
- header_txt.append('#include <unordered_map>')
- header_txt.append('')
header_txt.append('// The following is #included again to catch certain OS-specific functions being used:')
header_txt.append('#include "vk_loader_platform.h"')
header_txt.append('')