KiCad PCB EDA Suite
Loading...
Searching...
No Matches
project_file_patch.cpp File Reference
#include <diff_merge/project_file_patch.h>
#include <diff_merge/kicad_diff_types.h>
#include <json_common.h>
#include <kiplatform/io.h>
#include <wx/filefn.h>
#include <wx/log.h>
#include <wx/stdstream.h>
#include <wx/wfstream.h>
#include <unordered_map>

Go to the source code of this file.

Namespaces

namespace  KICAD_DIFF
 

Functions

std::optional< std::string > KICAD_DIFF::DocPropJsonPointer (const wxString &aDocProp, DOC_KIND aKind)
 Return the JSON pointer (RFC 6901, slash-separated) under which aDocProp is persisted in a .kicad_pro project file.
 
std::optional< std::string > KICAD_DIFF::DocPropJsonPointer (const wxString &aDocProp)
 
bool KICAD_DIFF::ApplyProjectFilePatch (nlohmann::json &aTarget, const nlohmann::json &aSource, const wxString &aDocProp, DOC_KIND aKind)
 Copy the JSON sub-tree located at the pointer for aDocProp from aSource into aTarget.
 
bool KICAD_DIFF::ApplyProjectFilePatch (nlohmann::json &aTarget, const nlohmann::json &aSource, const wxString &aDocProp)
 
bool KICAD_DIFF::ApplyProjectFilePatches (const wxString &aOutputProPath, const nlohmann::json &aSource, const std::set< wxString > &aDocProps, DOC_KIND aKind)
 Higher-level orchestrator: load the existing aOutputProPath as JSON (or start from aSource if the file doesn't exist), apply each DOC_PROP patch from aSource via ApplyProjectFilePatch, and write the result back to aOutputProPath.
 
bool KICAD_DIFF::ApplyProjectFilePatches (const wxString &aOutputProPath, const nlohmann::json &aSource, const std::set< wxString > &aDocProps)