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)
 
 ~LispyCommandMessageTarget () override
 
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 116 of file CommandTargets.h.

Constructor & Destructor Documentation

◆ LispyCommandMessageTarget()

LispyCommandMessageTarget::LispyCommandMessageTarget ( CommandMessageTarget target)
inline

Definition at line 120 of file CommandTargets.h.

CommandMessageTargetDecorator(CommandMessageTarget &target)

◆ ~LispyCommandMessageTarget()

LispyCommandMessageTarget::~LispyCommandMessageTarget ( )
overridedefault

Member Function Documentation

◆ AddBool()

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

Reimplemented from CommandMessageTargetDecorator.

Definition at line 152 of file CommandTargets.cpp.

152 {
153 if( name.empty() )
154 Update( wxString::Format( "%s%s", (mCounts.back()>0)?" ":"",value?"True":"False"));
155 else
156 Update( wxString::Format( "%s(%s %s)", (mCounts.back()>0)?" ":"", name,value?"True":"False"));
157 mCounts.back() += 1;
158}
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 159 of file CommandTargets.cpp.

159 {
160 if( name.empty() )
161 Update( wxString::Format( "%s%g", (mCounts.back()>0)?" ":"", value));
162 else
163 Update( wxString::Format( "%s(%s %g)", (mCounts.back()>0)?" ":"", name,value));
164 mCounts.back() += 1;
165}

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 144 of file CommandTargets.cpp.

144 {
145 wxString Padding;
146 if( name.empty() )
147 Update( wxString::Format( "%s%s\"%s\"", (mCounts.back()>0)?" ":"", Padding, Escaped(value)));
148 else
149 Update( wxString::Format( "%s%s(%s \"%s\")", (mCounts.back()>0)?" ":"", Padding, name, Escaped(value)));
150 mCounts.back() += 1;
151}
wxString Escaped(const wxString &str)

References TranslatableString::empty(), CommandMessageTarget::Escaped(), CommandMessageTarget::mCounts, name, audacity::cloud::audiocom::sync::anonymous_namespace{CloudSyncStatusField.cpp}::Padding, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

◆ EndArray()

void LispyCommandMessageTarget::EndArray ( )
overridevirtual

Reimplemented from CommandMessageTargetDecorator.

Definition at line 125 of file CommandTargets.cpp.

125 {
126 if( mCounts.size() > 1 ){
127 mCounts.pop_back();
128 }
129 Update( ")" );
130}

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 173 of file CommandTargets.cpp.

173 {
174 if( mCounts.size() > 1 ){
175 mCounts.pop_back();
176 }
177 Update( ")" );
178}

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 138 of file CommandTargets.cpp.

138 {
139 if( mCounts.size() > 1 ){
140 mCounts.pop_back();
141 }
142 Update( ")" );
143}

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 116 of file CommandTargets.cpp.

117{
118 wxString Padding;
119 Padding.Pad( mCounts.size() *2 -2);
120 Update( wxString::Format( (mCounts.back()>0)?"\n%s(":"(", Padding ));
121 mCounts.back() += 1;
122 mCounts.push_back( 0 );
123}

References CommandMessageTarget::mCounts, audacity::cloud::audiocom::sync::anonymous_namespace{CloudSyncStatusField.cpp}::Padding, 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 167 of file CommandTargets.cpp.

167 {
168 Update( wxString::Format( "%s(%s", (mCounts.back()>0)?" ":"", name ));
169 mCounts.back() += 1;
170 mCounts.push_back( 0 );
171}

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 131 of file CommandTargets.cpp.

131 {
132 wxString Padding;
133 Padding.Pad( mCounts.size() *2 -2);
134 Update( wxString::Format( (mCounts.back()>0)?"\n%s(":"(", Padding ));
135 mCounts.back() += 1;
136 mCounts.push_back( 0 );
137}

References CommandMessageTarget::mCounts, audacity::cloud::audiocom::sync::anonymous_namespace{CloudSyncStatusField.cpp}::Padding, and CommandMessageTargetDecorator::Update().

Here is the call graph for this function:

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