Created
March 23, 2021 05:51
-
-
Save MonteLogic/600ecb95737ad55bcfdfd84a860b6b9d to your computer and use it in GitHub Desktop.
How come when
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How come I cannot grab this file and read it, I've linked the logic but I'm struggling with the .existsAsFile() method. What can | |
I do I can import the xml file? | |
Folder structure image on imgur -> | |
https://imgur.com/vvX4AdD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
============================================================================== | |
LoadSaveXml.h | |
Created: 22 Mar 2021 5:02:11am | |
Author: dc | |
============================================================================== | |
*/ | |
#pragma once | |
#include <JuceHeader.h> | |
//============================================================================== | |
/* | |
*/ | |
class LoadSaveXml : public juce::Component | |
{ | |
public: | |
LoadSaveXml() | |
{ | |
// In your constructor, you should add any child components, and | |
// initialise any special settings that your component needs. | |
Logger::outputDebugString("Statement 4, This statement is coming from LoadSaveXml.h , gracias"); | |
loadData(); | |
} | |
~LoadSaveXml() override | |
{ | |
} | |
void loadData() { | |
Logger::outputDebugString("Statement 5, This statement is inside the method loadData"); | |
auto dir = juce::File::getCurrentWorkingDirectory(); | |
dir = dir.getParentDirectory(); | |
// auto myxmlfile = dir.getChildFile("resources").getChildFile("filepaths.xml"); | |
auto myxmlfile = dir.getChildFile("resources").getChildFile("filepaths.xml"); | |
auto outputNameofFile = myxmlfile.getFileName(); | |
Logger::outputDebugString("Below is the statement"); | |
if (!myxmlfile.existsAsFile()) { | |
Logger::outputDebugString(outputNameofFile); | |
} | |
} | |
void resized() override | |
{ | |
// This method is where you should set the bounds of any child | |
// components that your component contains.. | |
} | |
private: | |
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LoadSaveXml) | |
std::unique_ptr<juce::XmlElement> xmlMadeThing; | |
juce::XmlElement* madeList = nullptr; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment