Move wxStringSplit to kicad_string

This commit is contained in:
Marek Roszko 2020-10-23 22:06:42 -04:00
parent b7f115bf5f
commit 304e5faf36
10 changed files with 39 additions and 33 deletions

View File

@ -41,6 +41,7 @@
#include <pcb_text.h>
#include <fp_shape.h>
#include <class_zone.h>
#include <kicad_string.h>
#include <fp_text.h>
#include <convert_basic_shapes_to_polygon.h>
#include <trigo.h>

View File

@ -313,29 +313,6 @@ void SelectReferenceNumber( wxTextEntry* aTextEntry )
}
void wxStringSplit( const wxString& aText, wxArrayString& aStrings, wxChar aSplitter )
{
wxString tmp;
for( unsigned ii = 0; ii < aText.Length(); ii++ )
{
if( aText[ii] == aSplitter )
{
aStrings.Add( tmp );
tmp.Clear();
}
else
tmp << aText[ii];
}
if( !tmp.IsEmpty() )
{
aStrings.Add( tmp );
}
}
int ProcessExecute( const wxString& aCommandLine, int aFlags, wxProcess *callback )
{
return (int) wxExecute( aCommandLine, aFlags, callback );

View File

@ -24,6 +24,7 @@
#include <html_messagebox.h>
#include <kicad_string.h>
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle,
const wxPoint& aPosition, const wxSize& aSize ) :

View File

@ -790,3 +790,26 @@ bool ReplaceIllegalFileNameChars( wxString& aName, int aReplaceChar )
return changed;
}
void wxStringSplit( const wxString& aText, wxArrayString& aStrings, wxChar aSplitter )
{
wxString tmp;
for( unsigned ii = 0; ii < aText.Length(); ii++ )
{
if( aText[ii] == aSplitter )
{
aStrings.Add( tmp );
tmp.Clear();
}
else
tmp << aText[ii];
}
if( !tmp.IsEmpty() )
{
aStrings.Add( tmp );
}
}

View File

@ -34,6 +34,7 @@
#include <msgpanel.h>
#include <gal/stroke_font.h>
#include <bitmaps.h>
#include <kicad_string.h>
#include <sch_text.h>
#include <schematic.h>
#include <settings/color_settings.h>

View File

@ -253,15 +253,6 @@ void SelectReferenceNumber( wxTextEntry* aTextEntry );
int ProcessExecute( const wxString& aCommandLine, int aFlags = wxEXEC_ASYNC,
wxProcess *callback = NULL );
/**
* Split \a aString to a string list separated at \a aSplitter.
*
* @param aText is the text to split
* @param aStrings will contain the splitted lines
* @param aSplitter is the 'split' character
*/
void wxStringSplit( const wxString& aText, wxArrayString& aStrings, wxChar aSplitter );
/**
* Return the help file's full path.
* <p>

View File

@ -301,4 +301,14 @@ inline void AccumulateDescription( wxString& aDesc, const wxString& aItem )
}
/**
* Split \a aString to a string list separated at \a aSplitter.
*
* @param aText is the text to split
* @param aStrings will contain the splitted lines
* @param aSplitter is the 'split' character
*/
void wxStringSplit( const wxString& aText, wxArrayString& aStrings, wxChar aSplitter );
#endif // KICAD_STRING_H_

View File

@ -28,6 +28,7 @@
#include <class_board.h>
#include <class_pad.h>
#include <class_track.h>
#include <kicad_string.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <class_zone.h>

View File

@ -32,6 +32,7 @@
#include <pcbnew_settings.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>
#include <kicad_string.h>
#include <kiface_i.h>
#include <dialog_footprint_wizard_list.h>
#include <footprint_wizard_frame.h>

View File

@ -28,13 +28,13 @@
#include <vector> // for vector, __vector_base<>...
#include <eda_item.h>
#include <common.h>
#include <convert_basic_shapes_to_polygon.h>
#include <geometry/seg.h> // for SEG
#include <geometry/shape_circle.h>
#include <geometry/shape_line_chain.h> // for SHAPE_LINE_CHAIN
#include <geometry/shape_poly_set.h> // for SHAPE_POLY_SET, SHAPE_P...
#include <geometry/shape_segment.h>
#include <kicad_string.h>
#include <math/util.h> // for KiROUND, Clamp
#include <math/vector2d.h> // for VECTOR2I
#include <plotter.h>