KiCad PCB EDA Suite
altium_parser.cpp File Reference
#include "altium_parser.h"
#include "altium_parser_utils.h"
#include <compoundfilereader.h>
#include <ki_exception.h>
#include <math/util.h>
#include <numeric>
#include <sstream>
#include <utf.h>
#include <wx/log.h>
#include <wx/translation.h>

Go to the source code of this file.

Functions

std::string FormatPath (const std::vector< std::string > &aVectorPath)
 Helper for debug logging (vector -> string) More...
 
static const CFB::COMPOUND_FILE_ENTRY * FindStreamSingleLevel (const CFB::CompoundFileReader &aReader, const CFB::COMPOUND_FILE_ENTRY *aEntry, const std::string aName, const bool aIsStream)
 

Function Documentation

◆ FindStreamSingleLevel()

static const CFB::COMPOUND_FILE_ENTRY * FindStreamSingleLevel ( const CFB::CompoundFileReader &  aReader,
const CFB::COMPOUND_FILE_ENTRY *  aEntry,
const std::string  aName,
const bool  aIsStream 
)
static

Definition at line 92 of file altium_parser.cpp.

95{
96 const CFB::COMPOUND_FILE_ENTRY* ret = nullptr;
97
98 aReader.EnumFiles( aEntry, 1,
99 [&]( const CFB::COMPOUND_FILE_ENTRY* entry, const CFB::utf16string& dir,
100 int level ) -> void
101 {
102 if( aReader.IsStream( entry ) == aIsStream )
103 {
104 std::string name = UTF16ToUTF8( entry->name );
105 if( name == aName.c_str() )
106 {
107 ret = entry;
108 }
109 }
110 } );
111 return ret;
112}

Referenced by ALTIUM_COMPOUND_FILE::FindStream().

◆ FormatPath()

std::string FormatPath ( const std::vector< std::string > &  aVectorPath)

Helper for debug logging (vector -> string)

Parameters
aVectorPathpath
Returns
path formatted as string

Definition at line 38 of file altium_parser.cpp.

39{
40 return std::accumulate( aVectorPath.cbegin(), aVectorPath.cend(), std::string(),
41 []( const std::string& ss, const std::string& s )
42 {
43 return ss.empty() ? s : ss + '\\' + s;
44 } );
45}

Referenced by ALTIUM_DESIGNER_PLUGIN::FootprintEnumerate(), ALTIUM_PCB::Parse(), ALTIUM_PCB::ParseFootprint(), and ALTIUM_PCB::ParseModelsData().