|
Panini 1.4.0
Header-only library for generating C++, written in C++17
|
Writes output to a path only when the written bytes differ from what was loaded on disk. More...
#include <CompareWriter.hpp>
Public Member Functions | |
| CompareWriter (const CompareWriterConfig &config={}) | |
| CompareWriter (const std::filesystem::path &filePath, const WriterConfig &config=WriterConfig()) | |
| ~CompareWriter () override | |
| bool | IsChanged () const override |
Public Member Functions inherited from panini::ConfiguredWriter< CompareWriterConfig > | |
| ConfiguredWriter (const CompareWriterConfig &config=CompareWriterConfig {}) | |
| virtual | ~ConfiguredWriter ()=default |
| const WriterConfig & | GetConfig () const override |
| BraceBreakingStyle | GetBraceBreakingStyle () const override |
| IncludeStyle | GetIncludeStyle () const override |
| bool | IsOnNewLine () const override |
| Writer & | operator<< (const std::string &chunk) override |
| Writer & | operator<< (const char *chunkString) override |
| Writer & | operator<< (const NextLine &command) override |
| Writer & | operator<< (const IndentPush &command) override |
| Writer & | operator<< (const IndentPop &command) override |
| Writer & | operator<< (Command &&command) override |
| void | SetIsInCommentBlock (bool value) override |
| bool | Commit (bool force=false) override |
Public Member Functions inherited from panini::Writer | |
| virtual | ~Writer ()=default |
Protected Member Functions | |
| void | Write (const std::string &chunk) override |
| bool | OnCommit (bool force=false) override |
Protected Member Functions inherited from panini::ConfiguredWriter< CompareWriterConfig > | |
| void | WriteNewLine () override |
Protected Attributes | |
| bool | m_pathExists = false |
| std::string | m_writtenPrevious |
| std::string | m_writtenCurrent |
Protected Attributes inherited from panini::ConfiguredWriter< CompareWriterConfig > | |
| CompareWriterConfig | m_config |
Writes output to a path only when the written bytes differ from what was loaded on disk.
The CompareWriter stores the contents of the target path first. When the new output differs from what was seen before, the output will be committed to the path.
|
inlineexplicit |
Construct and configure the writer.
| config | Configuration instance. |
|
inlineexplicit |
Construct and configure the writer.
| filePath | File that will be compared against the output. |
| config | Configuration instance. |
|
inlineoverride |
Will call Commit() automatically when the writer is destroyed.
|
inlineoverridevirtual |
Check if the output was changed compared to what was read from disk when the CompareWriter was created.
Reimplemented from panini::ConfiguredWriter< CompareWriterConfig >.
|
inlineoverrideprotectedvirtual |
Checks if the writer should commit its output to the target.
Implements panini::Writer.
|
inlineoverrideprotectedvirtual |
Writes chunks to the output.
Implements panini::Writer.
|
protected |
|
protected |
|
protected |