rename filesystem namespace

This commit is contained in:
Martin Brodbeck 2018-08-09 16:37:56 +02:00
parent a3d95101b3
commit dac46935c7
3 changed files with 16 additions and 10 deletions

View file

@ -3,7 +3,9 @@
#include <xlnt/xlnt.hpp>
#include <fstream>
void ExcelReader::readSellersFromFile(const std::filesystem::path& filePath, Marketplace* market)
namespace fs = std::filesystem;
void ExcelReader::readSellersFromFile(const fs::path& filePath, Marketplace* market)
{
xlnt::workbook wb;
std::ifstream mystream(filePath, std::ios::binary);

View file

@ -5,7 +5,9 @@
#include <fstream>
void JsonUtil::exportSellers(const std::filesystem::path& filePath, Marketplace* market)
namespace fs = std::filesystem;
void JsonUtil::exportSellers(const fs::path& filePath, Marketplace* market)
{
Json::Value root;
std::ofstream file(filePath);
@ -29,7 +31,7 @@ void JsonUtil::exportSellers(const std::filesystem::path& filePath, Marketplace*
writer->write(root, &file);
}
void JsonUtil::importSellers(const std::filesystem::path& filePath, Marketplace* market)
void JsonUtil::importSellers(const fs::path& filePath, Marketplace* market)
{
for (auto& seller : market->getSellers()) {
seller->setState(Seller::State::DELETE);
@ -67,7 +69,7 @@ void JsonUtil::importSellers(const std::filesystem::path& filePath, Marketplace*
market->storeToDb();
}
void JsonUtil::exportSales(const std::filesystem::path& filePath, Marketplace* market, int cashPointNo)
void JsonUtil::exportSales(const fs::path& filePath, Marketplace* market, int cashPointNo)
{
Json::Value root;
std::ofstream file(filePath);
@ -106,7 +108,7 @@ void JsonUtil::exportSales(const std::filesystem::path& filePath, Marketplace* m
writer->write(root, &file);
}
void JsonUtil::importSales(const std::filesystem::path& filePath, Marketplace* market, int cashPointNo)
void JsonUtil::importSales(const fs::path& filePath, Marketplace* market, int cashPointNo)
{
Json::Value jsonValues;
std::ifstream file(filePath);