KiCad PCB EDA Suite
Loading...
Searching...
No Matches
X2_ATTRIBUTE Class Reference

The attribute value consists of a number of substrings separated by a comma. More...

#include <X2_gerber_attributes.h>

Inheritance diagram for X2_ATTRIBUTE:
X2_ATTRIBUTE_FILEFUNCTION

Public Member Functions

 X2_ATTRIBUTE ()
 
 ~X2_ATTRIBUTE ()
 
wxArrayString & GetPrms ()
 
const wxString & GetPrm (int aIdx)
 
const wxString & GetAttribute ()
 
int GetPrmCount ()
 
bool ParseAttribCmd (FILE *aFile, char *aBuffer, int aBuffSize, char *&aText, int &aLineNum)
 Parse a TF command terminated with a % and fill m_Prms by the parameters found.
 
void DbgListPrms ()
 Debug function: print using wxLogMessage le list of parameters.
 
bool IsFileFunction ()
 Return true if the attribute is .FileFunction.
 
bool IsFileMD5 ()
 Return true if the attribute is .MD5.
 
bool IsFilePart ()
 Return true if the attribute is .Part.
 

Protected Attributes

wxArrayString m_Prms
 the list of parameters (after TF) in gbr file the first one is the attribute name, if starting by '.
 

Detailed Description

The attribute value consists of a number of substrings separated by a comma.

Definition at line 53 of file X2_gerber_attributes.h.

Constructor & Destructor Documentation

◆ X2_ATTRIBUTE()

X2_ATTRIBUTE::X2_ATTRIBUTE ( )

Definition at line 49 of file X2_gerber_attributes.cpp.

◆ ~X2_ATTRIBUTE()

X2_ATTRIBUTE::~X2_ATTRIBUTE ( )

Definition at line 54 of file X2_gerber_attributes.cpp.

Member Function Documentation

◆ DbgListPrms()

void X2_ATTRIBUTE::DbgListPrms ( )

Debug function: print using wxLogMessage le list of parameters.

Definition at line 76 of file X2_gerber_attributes.cpp.

References GetPrmCount(), and m_Prms.

◆ GetAttribute()

const wxString & X2_ATTRIBUTE::GetAttribute ( )
Returns
the attribute name (for instance .FileFunction) which is given by TF command (i.e. the first parameter read).

Definition at line 59 of file X2_gerber_attributes.cpp.

References m_Prms.

Referenced by IsFileFunction(), IsFileMD5(), and IsFilePart().

◆ GetPrm()

const wxString & X2_ATTRIBUTE::GetPrm ( int  aIdx)
Returns
a parameter read in TF command.
Parameters
aIdx= the index of the parameter aIdx = 0 is the parameter read after the TF function (the same as GetAttribute())

Definition at line 65 of file X2_gerber_attributes.cpp.

References dummy, GetPrmCount(), and m_Prms.

Referenced by GERBER_FILE_IMAGE::RemoveAttribute().

◆ GetPrmCount()

int X2_ATTRIBUTE::GetPrmCount ( )
inline
Returns
the number of parameters read in TF (or similar like TA TO ...) command.

Definition at line 82 of file X2_gerber_attributes.h.

References m_Prms.

Referenced by DbgListPrms(), GetPrm(), and X2_ATTRIBUTE_FILEFUNCTION::X2_ATTRIBUTE_FILEFUNCTION().

◆ GetPrms()

wxArrayString & X2_ATTRIBUTE::GetPrms ( )
inline
Returns
the parameters list read in TF command.

Definition at line 62 of file X2_gerber_attributes.h.

References m_Prms.

Referenced by X2_ATTRIBUTE_FILEFUNCTION::X2_ATTRIBUTE_FILEFUNCTION().

◆ IsFileFunction()

bool X2_ATTRIBUTE::IsFileFunction ( )
inline

Return true if the attribute is .FileFunction.

Definition at line 106 of file X2_gerber_attributes.h.

References GetAttribute().

◆ IsFileMD5()

bool X2_ATTRIBUTE::IsFileMD5 ( )
inline

Return true if the attribute is .MD5.

Definition at line 114 of file X2_gerber_attributes.h.

References GetAttribute().

◆ IsFilePart()

bool X2_ATTRIBUTE::IsFilePart ( )
inline

Return true if the attribute is .Part.

Definition at line 122 of file X2_gerber_attributes.h.

References GetAttribute().

◆ ParseAttribCmd()

bool X2_ATTRIBUTE::ParseAttribCmd ( FILE *  aFile,
char *  aBuffer,
int  aBuffSize,
char *&  aText,
int &  aLineNum 
)

Parse a TF command terminated with a % and fill m_Prms by the parameters found.

Parameters
aFile= a FILE* ptr to the current Gerber file.
aBuffer= the buffer containing current Gerber data (can be null)
aBuffSize= the size of the buffer
aText= a pointer to the first char to read from Gerber data stored in aBuffer After parsing, text points the last char of the command line ('') (X2 mode) or the end of line if the line does not contain '' or aBuffer == NULL (X1 mode)
aLineNum= a point to the current line number of aFile
Returns
true if no error.

Definition at line 85 of file X2_gerber_attributes.cpp.

References From_UTF8(), and m_Prms.

Member Data Documentation

◆ m_Prms


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