yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1#ifndef SLANG_HEX_DUMP_UTIL_H 2#define SLANG_HEX_DUMP_UTIL_H 3 4#include "slang-common.h" 5#include "slang-list.h" 6#include "slang-string.h" 7#include "slang.h" 8 9namespace Slang 10{ 11 12struct HexDumpUtil 13{ 14/// Dump out bytes in source format - as in 15/// 0x10, 0xab, 16static SlangResult dumpSourceBytes ( 17const uint8_t * data , 18size_t dataCount , 19int maxBytesPerLine , 20ISlangWriter * writer ); 21 22/// Dump data to writer, with lines starting with hex data 23static SlangResult dump (const List < uint8_t >& data ,int numBytesPerLine ,ISlangWriter * writer ); 24 25static SlangResult dump ( 26const uint8_t * data , 27size_t dataCount , 28int numBytesPerLine , 29ISlangWriter * writer ); 30 31/// Dump a single value 32static void dump (uint32_t value ,ISlangWriter * writer ); 33 34static SlangResult dumpWithMarkers ( 35const List < uint8_t >& data , 36int numBytesPerLine , 37ISlangWriter * writer ); 38 39static SlangResult dumpWithMarkers ( 40const uint8_t * data , 41size_t dataSize , 42int numBytesPerLine , 43ISlangWriter * writer ); 44 45/// Parses lines formatted by dump, back into bytes 46static SlangResult parse (const UnownedStringSlice & lines ,List < uint8_t >& outBytes ); 47 48static SlangResult parseWithMarkers (const UnownedStringSlice & lines ,List < uint8_t >& outBytes ); 49 50static SlangResult findStartAndEndLines ( 51const UnownedStringSlice & lines , 52UnownedStringSlice & outStart , 53UnownedStringSlice & outEnd ); 54}; 55 56}// namespace Slang 57 58#endif