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 <algorithm>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <xlnt/workbook/manifest.hpp>
|
#include <xlnt/packaging/manifest.hpp>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -5,26 +5,29 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <detail/include_windows.hpp>
|
#include <detail/include_windows.hpp>
|
||||||
|
#include <helpers/path_helper.hpp>
|
||||||
#include "path_helper.hpp"
|
|
||||||
|
|
||||||
class TemporaryFile
|
class TemporaryFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static std::string CreateTemporaryFilename()
|
static std::string CreateTemporaryFilename()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
std::array<TCHAR, MAX_PATH> buffer;
|
std::array<TCHAR, MAX_PATH> buffer;
|
||||||
DWORD result = GetTempPath(static_cast<DWORD>(buffer.size()), buffer.data());
|
DWORD result = GetTempPath(static_cast<DWORD>(buffer.size()), buffer.data());
|
||||||
|
|
||||||
if(result > MAX_PATH)
|
if(result > MAX_PATH)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("buffer is too small");
|
throw std::runtime_error("buffer is too small");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result == 0)
|
if(result == 0)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("GetTempPath failed");
|
throw std::runtime_error("GetTempPath failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string directory(buffer.begin(), buffer.begin() + result);
|
std::string directory(buffer.begin(), buffer.begin() + result);
|
||||||
|
|
||||||
return PathHelper::WindowsToUniversalPath(directory + "xlnt.xlsx");
|
return PathHelper::WindowsToUniversalPath(directory + "xlnt.xlsx");
|
||||||
#else
|
#else
|
||||||
return "/tmp/xlnt.xlsx";
|
return "/tmp/xlnt.xlsx";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user