Audacity 3.2.0
Public Member Functions | List of all members
LispyCommandMessageTarget Class Reference

LispyCommandMessageTarget is a CommandOutputTarget that provides status in a lispy style. More...

#include <CommandTargets.h>

Inheritance diagram for LispyCommandMessageTarget:
[legend]
Collaboration diagram for LispyCommandMessageTarget:
[legend]

Public Member Functions

 LispyCommandMessageTarget (CommandMessageTarget &target)
 
virtual void StartArray () override
 
virtual void EndArray () override
 
virtual void StartStruct () override
 
virtual void EndStruct () override
 
virtual void AddItem (const wxString &value, const wxString &name={}) override
 
virtual void AddBool (const bool value, const wxString &name={}) override
 
virtual void AddItem (const double value, const wxString &name={}) override
 
virtual void StartField (const wxString &name={}) override
 
virtual void EndField () override
 
- Public Member Functions inherited from CommandMessageTargetDecorator
 CommandMessageTargetDecorator (CommandMessageTarget &target)
 
 ~CommandMessageTargetDecorator () override
 
void Update (const wxString &message) override
 
void StartArray () override
 
void EndArray () override
 
void StartStruct () override
 
void EndStruct () override
 
void AddItem (const wxString &value, const wxString &name={}) override
 
void AddBool (const bool value, const wxString &name={}) override
 
void AddItem (const double value, const wxString &name={}) override
 
void StartField (const wxString &name={}) override
 
void EndField () override
 
void Flush () override
 
- Public Member Functions inherited from CommandMessageTarget
 CommandMessageTarget ()
 
virtual ~CommandMessageTarget ()
 
virtual void Update (const wxString &message)=0
 
virtual void StartArray ()
 
virtual void EndArray ()
 
virtual void StartStruct ()
 
virtual void EndStruct ()
 
virtual void AddItem (const wxString &value, const wxString &name={})
 
virtual void AddBool (const bool value, const wxString &name={})
 
virtual void AddItem (const double value, const wxString &name={})
 
virtual void StartField (const wxString &name={})
 
virtual void EndField ()
 
virtual void Flush ()
 
wxString Escaped (const wxString &str)
 

Additional Inherited Members

- Public Attributes inherited from CommandMessageTargetDecorator
CommandMessageTargetmTarget
 
- Public Attributes inherited from CommandMessageTarget
std::vector< int > mCounts
 

Detailed Description

LispyCommandMessageTarget is a CommandOutputTarget that provides status in a lispy style.

Definition at line 119 of file CommandTargets.h.

Constructor & Destructor Documentation

◆ LispyCommandMessageTarget()

LispyCommandMessageTarget::LispyCommandMessageTarget ( CommandMessageTarget target)
inline

Definition at line 122 of file CommandTargets.h.

CommandMessageTargetDecorator(CommandMessageTarget &target)

Member Function Documentation

◆ AddBool()

void LispyCommandMessageTarget::AddBool ( const bool  value,
const wxString &  name = {} 
)
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 160 of file CommandTargets.cpp.

160 {
161 if( name.empty() )
162 Update( wxString::Format( "%s%s", (mCounts.back()>0)?" ":"",value?"True":"False"));
163 else
164 Update( wxString::Format( "%s(%s %s)", (mCounts.back()>0)?" ":"", name,value?"True":"False"));
165 mCounts.back() += 1;
166}
const TranslatableString name
Definition: Distortion.cpp:76
void Update(const wxString &message) override
std::vector< int > mCounts

References TranslatableString::empty(), CommandMessageTarget::mCounts, name, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ AddItem() [1/2]

void LispyCommandMessageTarget::AddItem ( const double  value,
const wxString &  name = {} 
)
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 167 of file CommandTargets.cpp.

167 {
168 if( name.empty() )
169 Update( wxString::Format( "%s%g", (mCounts.back()>0)?" ":"", value));
170 else
171 Update( wxString::Format( "%s(%s %g)", (mCounts.back()>0)?" ":"", name,value));
172 mCounts.back() += 1;
173}

References TranslatableString::empty(), CommandMessageTarget::mCounts, name, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ AddItem() [2/2]

void LispyCommandMessageTarget::AddItem ( const wxString &  value,
const wxString &  name = {} 
)
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 152 of file CommandTargets.cpp.

152 {
153 wxString Padding;
154 if( name.empty() )
155 Update( wxString::Format( "%s%s\"%s\"", (mCounts.back()>0)?" ":"", Padding, Escaped(value)));
156 else
157 Update( wxString::Format( "%s%s(%s \"%s\")", (mCounts.back()>0)?" ":"", Padding, name, Escaped(value)));
158 mCounts.back() += 1;
159}
wxString Escaped(const wxString &str)

References TranslatableString::empty(), CommandMessageTarget::Escaped(), CommandMessageTarget::mCounts, name, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ EndArray()

void LispyCommandMessageTarget::EndArray ( )
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 133 of file CommandTargets.cpp.

133 {
134 if( mCounts.size() > 1 ){
135 mCounts.pop_back();
136 }
137 Update( ")" );
138}

References CommandMessageTarget::mCounts, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ EndField()

void LispyCommandMessageTarget::EndField ( )
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 181 of file CommandTargets.cpp.

181 {
182 if( mCounts.size() > 1 ){
183 mCounts.pop_back();
184 }
185 Update( ")" );
186}

References CommandMessageTarget::mCounts, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ EndStruct()

void LispyCommandMessageTarget::EndStruct ( )
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 146 of file CommandTargets.cpp.

146 {
147 if( mCounts.size() > 1 ){
148 mCounts.pop_back();
149 }
150 Update( ")" );
151}

References CommandMessageTarget::mCounts, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ StartArray()

void LispyCommandMessageTarget::StartArray ( )
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 124 of file CommandTargets.cpp.

125{
126 wxString Padding;
127 Padding.Pad( mCounts.size() *2 -2);
128 Update( wxString::Format( (mCounts.back()>0)?"\n%s(":"(", Padding ));
129 mCounts.back() += 1;
130 mCounts.push_back( 0 );
131}

References CommandMessageTarget::mCounts, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ StartField()

void LispyCommandMessageTarget::StartField ( const wxString &  name = {})
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 175 of file CommandTargets.cpp.

175 {
176 Update( wxString::Format( "%s(%s", (mCounts.back()>0)?" ":"", name ));
177 mCounts.back() += 1;
178 mCounts.push_back( 0 );
179}

References CommandMessageTarget::mCounts, name, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ StartStruct()

void LispyCommandMessageTarget::StartStruct ( )
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 139 of file CommandTargets.cpp.

139 {
140 wxString Padding;
141 Padding.Pad( mCounts.size() *2 -2);
142 Update( wxString::Format( (mCounts.back()>0)?"\n%s(":"(", Padding ));
143 mCounts.back() += 1;
144 mCounts.push_back( 0 );
145}

References CommandMessageTarget::mCounts, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

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