KiCad PCB EDA Suite
altium_parser.h File Reference
#include <map>
#include <memory>
#include <math/util.h>
#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 33 of file altium_parser.cpp.

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