add missing runtime_error include and improperly located headers

This commit is contained in:
Thomas Fussell 2015-11-03 08:46:40 -05:00
parent 2c8ccdfcda
commit a2919dfed8
4 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#include <algorithm>
#include <stdexcept>
#include <xlnt/workbook/manifest.hpp>
#include <xlnt/packaging/manifest.hpp>
namespace {

View File

@ -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";