Gromacs  2026.0-dev-20251109-f20ba35
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::ScopedIndenter Class Reference

#include <gromacs/utility/include/gromacs/utility/textwriter.h>

Description

Helper class to increase the indentation of a TextWriter for the lifetime of this object.

Now it's easy to write code like

TextWriter writer(...); writeTitle(&writer, "some title"); { ScopedIndenter indenter = writer.addScopedIndentation(2); writer->writeString("I'm indented by 2 spaces"); writer->writeString("Me too"); } writer->writeString("I'm not indented any more");

Public Member Functions

 ScopedIndenter (TextWriter *writer, int extraIndentation=3)
 Requires the caller to ensure that writer outlives this object. More...
 

Constructor & Destructor Documentation

gmx::ScopedIndenter::ScopedIndenter ( TextWriter writer,
int  extraIndentation = 3 
)

Requires the caller to ensure that writer outlives this object.

The default for extra indentation matches that of the legacy txtdump implementation.


The documentation for this class was generated from the following files: