28#include <wx/tokenzr.h>
42 .default_value( std::string() )
48 .default_value( std::string() )
90 if( !aLayerString.IsEmpty() )
93 wxStringTokenizer layerTokens( aLayerString,
"," );
95 while( layerTokens.HasMoreTokens() )
97 std::string token =
TO_UTF8( layerTokens.GetNextToken() );
100 if( m_layerMasks.count( token ) )
102 layerMask |= m_layerMasks.at(token);
106 else if( m_layerGuiMasks.count( token ) )
108 layerMask |= m_layerGuiMasks.at(token);
113 wxFprintf( stderr,
_(
"Invalid layer name \"%s\"\n" ), token );
125 .default_value( std::string() )
127 _(
"Comma separated list of untranslated layer names to include such as "
130 m_hasLayerArg =
true;
131 m_requireLayers = aRequire;
141 LSET layerMask = convertLayerStringList( layers, m_selectedLayersSet );
142 if( m_requireLayers && layerMask.
Seq().size() < 1 )
144 wxFprintf( stderr,
_(
"At least one or more layers must be specified\n" ) );
148 m_selectedLayers = layerMask;
argparse::ArgumentParser m_argParser
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
static const int ERR_ARGS
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.
LSET convertLayerStringList(wxString &aLayerString, bool &aLayerArgSet) const
std::map< std::string, LSET > m_layerGuiMasks
std::map< std::string, LSET > m_layerMasks
EXPORT_PCB_BASE_COMMAND(const std::string &aName, bool aOutputIsDir=false)
void addLayerArg(bool aRequire)