rodecomp/Source/File/CommonObject.h
ragnarok-clanker 4fd6cd3ad7 Maintenance: Resubmission of batch 9115 rebased onto main (it conflicted with 9108's CommonObject.cpp change, which it already contai
Batch #9132 by ragnarok-clanker: forced by an admin (2 lower score(s), 13 changed function(s)); checked with 22 compiled unit(s), including every includer of Source/Contents/ForbiddenWords.h, Source/Contents/Party/PartyInvitation.h, Source/File/CommonObject.h, Source/UI/Chat/UIChatRoomTitle.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Party/UIRegisterPartyWnd.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIPetInfoWnd.h.
2026-11-01 02:10:48 +00:00

37 lines
1.1 KiB
C++

#ifndef RAGNAROK_SOURCE_FILE_COMMONOBJECT_H
#define RAGNAROK_SOURCE_FILE_COMMONOBJECT_H
#include <any>
#include <functional>
#include <string>
#include <vector>
class CFile;
class CCommonObject {
public:
// INLINED
CCommonObject() {
this->Clear();
}
virtual ~CCommonObject();
void Clear();
bool LoadTokens(std::vector<char*>& tokens, const char* name, int mode);
bool LoadCsv(const char* name, std::vector<std::string> (*transform)(const std::vector<std::string>&), void (*insert)(std::vector<const char*>&));
bool LoadCsv(const char* name, std::function<std::vector<std::string>(std::vector<std::string>&)> transform,
std::function<void(std::vector<const char*>&, std::any)> insert, std::any context);
private:
bool OpenCsv(const char* name, CFile& file);
std::vector<std::string> ReadCsvRow(CFile& file, char separator);
/* 0004 */ std::vector<char*> m_buffers;
CCommonObject(const CCommonObject&) = delete;
CCommonObject& operator=(const CCommonObject&) = delete;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CCommonObject) == 16);
#endif
#endif