18#ifndef _RBTBASEFILESINK_H_
19#define _RBTBASEFILESINK_H_
23#include "rxdock/Config.h"
25#include <nlohmann/json.hpp>
27using json = nlohmann::json;
40 friend void to_json(json &j,
const BaseFileSink &baseFileSink);
41 friend void from_json(
const json &j,
BaseFileSink &baseFileSink);
46 std::string GetFileName()
const {
return m_strFileName; }
48 void SetFileName(
const std::string &fileName);
49 bool StatusOK() {
return Status().isOK(); }
53 virtual void Render() = 0;
62 void Write(
bool bClearCache =
true);
64 void AddLine(
const std::string &fileRec);
66 void ReplaceLine(
const std::string &fileRec,
unsigned int nRec);
68 bool isCacheEmpty()
const {
return m_lineRecs.empty(); }
71 bool GetAppend()
const {
74 void SetAppend(
bool bAppend) {
88 void Open(
bool bAppend =
false);
101 std::vector<std::string> m_lineRecs;
102 std::string m_strFileName;
103 std::ofstream m_fileOut;
108void from_json(
const json &j,
BaseFileSink &baseFileSink);
Definition BaseFileSink.h:31
Definition SmartPointer.h:48