/////////////////////////////////////////////////////////////////////
// This open-source software sample is offered free of charge and without guarantee.
// Polhemus accepts no responsibility or liability for any use of this code.
/////////////////////////////////////////////////////////////////////
//  VSS $Header: /PiUpdater.root/PiUpdater/PiUpdaterLib/stdformat.h 1     6/21/19 4:55p Suzanne $  
//#include <cstdio>
//#include <cstdarg>
////#include <alloca.h>

#pragma once

#include <string>
#include <stdint.h>
//#include <iostream>

#ifdef _UNICODE
#define tstrformat				wstrformat
#define tstrformathexbuf		wstrformathexbuf
#define tstrformatasciihexbuf	wstrformatasciihexbuf
#else
#define tstrformat				strformat
#define tstrformathexbuf		strformathexbuf
#define tstrformatasciihexbuf	strformatasciihexbuf
#endif

namespace stdformat
{
	errno_t convertfromws(std::string &s, const std::wstring & ws);
	errno_t converttows(std::wstring &ws, const std::string & s);

	std::string strformat(const char* format, ...);

	//extern std::string strformathexbuf(uint8_t *, size_t, bool bCRLF = true);
	//extern std::string strformatasciihexbuf(uint8_t *, size_t, bool bCRLF = true);

	std::string strformathexbuf(uint8_t *, size_t, bool bCRLF = true, size_t trunc = 0x600);
	std::string strformatasciihexbuf(uint8_t *, size_t, bool bCRLF = true, size_t trunc = 0x600);


	std::wstring wstrformat(const wchar_t * format, ...);

	std::wstring wstrformathexbuf(uint8_t *, size_t, bool bCRLF = true, size_t trunc = 0x600);
	std::wstring wstrformatasciihexbuf(uint8_t *, size_t, bool bCRLF = true, size_t trunc = 0x600);

}
