Files
UNSWebServerCore_WindowsDLL/UNSWebServerCore/WebFileInfo.h
T

40 lines
1021 B
C++

#pragma once
#include <string>
#include <vector>
#include "Export.h"
#include "DateTime.h"
class UNSWSC_DLL_EXPORT WebFileInfo
{
private:
std::string OriginalFileName;
std::string StorageFileName;
std::string ExtensionName;
DateTime UploadTime;
size_t FileSize;
private:
std::string GetRandomNumber();
std::string GetExtension(std::string ofn);
std::string GenerateStorageName(std::string ofn);
public:
WebFileInfo() = default;
WebFileInfo(std::string ofn, size_t size);
WebFileInfo(std::string ofn, std::string sfn, std::string en, DateTime upt, size_t siz);
WebFileInfo(const WebFileInfo& obj);
public:
std::string MakePath(std::string storage_dir) const;
std::string GetOriginalFileName() const;
std::string GetStorageFileName() const;
std::string GetExtensionName() const;
DateTime GetUploadTime() const;
size_t GetFileSize() const;
public:
void SetStorageFileName(const std::string& sfn);
void SetOriginalFileName(const std::string& ofn);
};
using WebFileInfoVec = std::vector<WebFileInfo>;