KiCad PCB EDA Suite
sch_component.h File Reference

Definition the SCH_COMPONENT class for Eeschema. More...

#include <lib_id.h>
#include <sch_field.h>
#include <transform.h>
#include <general.h>
#include <vector>
#include <lib_draw_item.h>

Go to the source code of this file.

Classes

class  SCH_COMPONENT
 Class SCH_COMPONENT describes a real schematic component. More...
 

Typedefs

typedef std::vector< SCH_FIELDSCH_FIELDS
 A container for several SCH_FIELD items. More...
 
typedef std::weak_ptr< LIB_PARTPART_REF
 

Functions

std::string toUTFTildaText (const wxString &txt)
 Function toUTFTildaText convert a wxString to UTF8 and replace any control characters with a ~, where a control character is one of the first ASCII values up to ' ' 32d. More...
 

Detailed Description

Definition the SCH_COMPONENT class for Eeschema.

Definition in file sch_component.h.

Typedef Documentation

typedef std::weak_ptr<LIB_PART> PART_REF

Definition at line 59 of file sch_component.h.

typedef std::vector<SCH_FIELD> SCH_FIELDS

A container for several SCH_FIELD items.

Definition at line 53 of file sch_component.h.

Function Documentation

std::string toUTFTildaText ( const wxString &  txt)

Function toUTFTildaText convert a wxString to UTF8 and replace any control characters with a ~, where a control character is one of the first ASCII values up to ' ' 32d.

Definition at line 67 of file sch_component.cpp.

References TO_UTF8.

Referenced by SCH_COMPONENT::Save(), and SCH_LEGACY_PLUGIN::saveComponent().

68 {
69  std::string ret = TO_UTF8( txt );
70 
71  for( std::string::iterator it = ret.begin(); it!=ret.end(); ++it )
72  {
73  if( (unsigned char) *it <= ' ' )
74  *it = '~';
75  }
76  return ret;
77 }
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47