KiCad PCB EDA Suite
altium_parser.h File Reference
#include <map>
#include <memory>
#include <wx/gdicmn.h>
#include <vector>

Go to the source code of this file.

Classes

class  ALTIUM_PARSER
 

Namespaces

 CFB
 

Functions

const CFB::COMPOUND_FILE_ENTRY * FindStream (const CFB::CompoundFileReader &aReader, const char *aStreamName)
 

Function Documentation

◆ FindStream()

const CFB::COMPOUND_FILE_ENTRY* FindStream ( const CFB::CompoundFileReader &  aReader,
const char *  aStreamName 
)

Definition at line 35 of file altium_parser.cpp.

37 {
38  const CFB::COMPOUND_FILE_ENTRY* ret = nullptr;
39  aReader.EnumFiles( aReader.GetRootEntry(), -1,
40  [&]( const CFB::COMPOUND_FILE_ENTRY* aEntry, const CFB::utf16string& aU16dir,
41  int level ) -> void
42  {
43  if( aReader.IsStream( aEntry ) )
44  {
45  std::string name = UTF16ToUTF8( aEntry->name );
46  if( aU16dir.length() > 0 )
47  {
48  std::string dir = UTF16ToUTF8( aU16dir.c_str() );
49  if( strncmp( aStreamName, dir.c_str(), dir.length() ) == 0
50  && aStreamName[dir.length()] == '\\'
51  && strcmp( aStreamName + dir.length() + 1, name.c_str() ) == 0 )
52  {
53  ret = aEntry;
54  }
55  }
56  else
57  {
58  if( strcmp( aStreamName, name.c_str() ) == 0 )
59  {
60  ret = aEntry;
61  }
62  }
63  }
64  } );
65  return ret;
66 }
const char * name
Definition: DXF_plotter.cpp:59

References name.

Referenced by ALTIUM_PCB::Parse(), SCH_ALTIUM_PLUGIN::ParseFileHeader(), ALTIUM_PCB::ParseModelsData(), and SCH_ALTIUM_PLUGIN::ParseStorage().