mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
add missing runtime_error include and improperly located headers
This commit is contained in:
parent
2c8ccdfcda
commit
a2919dfed8
|
@ -1,6 +1,7 @@
|
|||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <xlnt/workbook/manifest.hpp>
|
||||
#include <xlnt/packaging/manifest.hpp>
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
|
@ -5,26 +5,29 @@
|
|||
#include <string>
|
||||
|
||||
#include <detail/include_windows.hpp>
|
||||
|
||||
#include "path_helper.hpp"
|
||||
#include <helpers/path_helper.hpp>
|
||||
|
||||
class TemporaryFile
|
||||
{
|
||||
public:
|
||||
static std::string CreateTemporaryFilename()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
std::array<TCHAR, MAX_PATH> buffer;
|
||||
DWORD result = GetTempPath(static_cast<DWORD>(buffer.size()), buffer.data());
|
||||
|
||||
if(result > MAX_PATH)
|
||||
{
|
||||
throw std::runtime_error("buffer is too small");
|
||||
}
|
||||
|
||||
if(result == 0)
|
||||
{
|
||||
throw std::runtime_error("GetTempPath failed");
|
||||
}
|
||||
|
||||
std::string directory(buffer.begin(), buffer.begin() + result);
|
||||
|
||||
return PathHelper::WindowsToUniversalPath(directory + "xlnt.xlsx");
|
||||
#else
|
||||
return "/tmp/xlnt.xlsx";
|
||||
|
|
Loading…
Reference in New Issue
Block a user