- add support for models, sounds and images to be able to load from commondata

This commit is contained in:
Mark Vejvoda
2011-05-05 07:15:12 +00:00
parent 102363f151
commit c3d1d6fca0
10 changed files with 96 additions and 79 deletions

View File

@@ -949,7 +949,7 @@ void MainWindow::loadUnit(string path, string skillName) {
foundSkillName = true; foundSkillName = true;
if(sn->getChild("animation") != NULL) { if(sn->getChild("animation") != NULL) {
skillModelFile = unitPath + '/' + sn->getChild("animation")->getAttribute("path")->getRestrictedValue(); skillModelFile = sn->getChild("animation")->getAttribute("path")->getRestrictedValue(unitPath + '/');
printf("Found skill model [%s]\n",skillModelFile.c_str()); printf("Found skill model [%s]\n",skillModelFile.c_str());
} }
@@ -962,7 +962,7 @@ void MainWindow::loadUnit(string path, string skillName) {
const XmlNode *pf= particlesNode->getChild("particle-file"); const XmlNode *pf= particlesNode->getChild("particle-file");
if(pf != NULL) { if(pf != NULL) {
skillParticleFile = unitPath + '/' + pf->getAttribute("path")->getRestrictedValue(); skillParticleFile = unitPath + '/' + pf->getAttribute("path")->getRestrictedValue();
printf("Found skill skill particle [%s]\n",skillParticleFile.c_str()); printf("Found skill particle [%s]\n",skillParticleFile.c_str());
} }
} }
} }

View File

@@ -57,8 +57,8 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
} }
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
texture->load(currentPath + textureNode->getAttribute("path")->getRestrictedValue()); texture->load(textureNode->getAttribute("path")->getRestrictedValue(currentPath));
loadedFileList[currentPath + textureNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[textureNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
} }
else { else {
texture= NULL; texture= NULL;
@@ -68,18 +68,18 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
if(particleSystemNode->hasChild("model")){ if(particleSystemNode->hasChild("model")){
const XmlNode *modelNode= particleSystemNode->getChild("model"); const XmlNode *modelNode= particleSystemNode->getChild("model");
bool modelEnabled= modelNode->getAttribute("value")->getBoolValue(); bool modelEnabled= modelNode->getAttribute("value")->getBoolValue();
if(modelEnabled){ if(modelEnabled) {
string path= modelNode->getAttribute("path")->getRestrictedValue();
model= renderer->newModel(rsGame);
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
model->load(currentPath + path, false, &loadedFileList); string path= modelNode->getAttribute("path")->getRestrictedValue(currentPath);
loadedFileList[currentPath + path]++; model= renderer->newModel(rsGame);
model->load(path, false, &loadedFileList);
loadedFileList[path]++;
} }
} }
else{ else {
model= NULL; model= NULL;
} }
@@ -151,7 +151,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
alternations= alternatingNode->getAttribute("value")->getIntValue(); alternations= alternatingNode->getAttribute("value")->getIntValue();
} }
//mode //mode
if(particleSystemNode->hasChild("mode")){ if(particleSystemNode->hasChild("mode")) {
const XmlNode *modeNode= particleSystemNode->getChild("mode"); const XmlNode *modeNode= particleSystemNode->getChild("mode");
mode= modeNode->getAttribute("value")->getRestrictedValue(); mode= modeNode->getAttribute("value")->getRestrictedValue();
} }

View File

@@ -56,8 +56,8 @@ void CommandType::load(int id, const XmlNode *n, const string &dir,
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
image->load(currentPath + imageNode->getAttribute("path")->getRestrictedValue()); image->load(imageNode->getAttribute("path")->getRestrictedValue(currentPath));
loadedFileList[currentPath + imageNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[imageNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
//unit requirements //unit requirements
const XmlNode *unitRequirementsNode= n->getChild("unit-requirements"); const XmlNode *unitRequirementsNode= n->getChild("unit-requirements");
@@ -390,15 +390,14 @@ void BuildCommandType::load(int id, const XmlNode *n, const string &dir,
startSounds.resize(startSoundNode->getChildCount()); startSounds.resize(startSoundNode->getChildCount());
for(int i=0; i<startSoundNode->getChildCount(); ++i){ for(int i=0; i<startSoundNode->getChildCount(); ++i){
const XmlNode *soundFileNode= startSoundNode->getChild("sound-file", i); const XmlNode *soundFileNode= startSoundNode->getChild("sound-file", i);
string path= soundFileNode->getAttribute("path")->getRestrictedValue(); string currentPath = dir;
trimPathWithStartingSlash(path); endPathWithSlash(currentPath);
string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath,true);
StaticSound *sound= new StaticSound(); StaticSound *sound= new StaticSound();
string currentPath = dir; sound->load(path);
endPathWithSlash(currentPath); loadedFileList[path]++;
sound->load(currentPath + path);
loadedFileList[currentPath + path]++;
startSounds[i]= sound; startSounds[i]= sound;
} }
} }
@@ -409,15 +408,14 @@ void BuildCommandType::load(int id, const XmlNode *n, const string &dir,
builtSounds.resize(builtSoundNode->getChildCount()); builtSounds.resize(builtSoundNode->getChildCount());
for(int i=0; i<builtSoundNode->getChildCount(); ++i){ for(int i=0; i<builtSoundNode->getChildCount(); ++i){
const XmlNode *soundFileNode= builtSoundNode->getChild("sound-file", i); const XmlNode *soundFileNode= builtSoundNode->getChild("sound-file", i);
string path= soundFileNode->getAttribute("path")->getRestrictedValue(); string currentPath = dir;
trimPathWithStartingSlash(path); endPathWithSlash(currentPath);
string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath,true);
StaticSound *sound= new StaticSound(); StaticSound *sound= new StaticSound();
string currentPath = dir; sound->load(path);
endPathWithSlash(currentPath); loadedFileList[path]++;
sound->load(currentPath + path);
loadedFileList[currentPath + path]++;
builtSounds[i]= sound; builtSounds[i]= sound;
} }
} }

View File

@@ -152,8 +152,8 @@ void FactionType::load(const string &dir, const TechTree *techTree, Checksum* ch
bool value= musicNode->getAttribute("value")->getBoolValue(); bool value= musicNode->getAttribute("value")->getBoolValue();
if(value) { if(value) {
music= new StrSound(); music= new StrSound();
music->open(currentPath + musicNode->getAttribute("path")->getRestrictedValue()); music->open(musicNode->getAttribute("path")->getRestrictedValue(currentPath));
loadedFileList[currentPath + musicNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[musicNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
} }
} }
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);

View File

@@ -74,8 +74,8 @@ void ResourceType::load(const string &dir, Checksum* checksum, Checksum *techtre
//image //image
const XmlNode *imageNode= resourceNode->getChild("image"); const XmlNode *imageNode= resourceNode->getChild("image");
image= renderer.newTexture2D(rsGame); image= renderer.newTexture2D(rsGame);
image->load(currentPath + imageNode->getAttribute("path")->getRestrictedValue()); image->load(imageNode->getAttribute("path")->getRestrictedValue(currentPath));
loadedFileList[currentPath + imageNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[imageNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
//type //type
const XmlNode *typeNode= resourceNode->getChild("type"); const XmlNode *typeNode= resourceNode->getChild("type");
@@ -87,7 +87,7 @@ void ResourceType::load(const string &dir, Checksum* checksum, Checksum *techtre
{ {
//model //model
const XmlNode *modelNode= typeNode->getChild("model"); const XmlNode *modelNode= typeNode->getChild("model");
string modelPath= currentPath + modelNode->getAttribute("path")->getRestrictedValue(); string modelPath= modelNode->getAttribute("path")->getRestrictedValue(currentPath);
model= renderer.newModel(rsGame); model= renderer.newModel(rsGame);
model->load(modelPath, false, &loadedFileList); model->load(modelPath, false, &loadedFileList);

View File

@@ -62,12 +62,13 @@ void SkillType::load(const XmlNode *sn, const string &dir, const TechTree *tt,
animSpeed= sn->getChild("anim-speed")->getAttribute("value")->getIntValue(); animSpeed= sn->getChild("anim-speed")->getAttribute("value")->getIntValue();
//model //model
string path= sn->getChild("animation")->getAttribute("path")->getRestrictedValue();
animation= Renderer::getInstance().newModel(rsGame);
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
animation->load(currentPath + path, false, &loadedFileList);
loadedFileList[currentPath + path]++; string path= sn->getChild("animation")->getAttribute("path")->getRestrictedValue(currentPath);
animation= Renderer::getInstance().newModel(rsGame);
animation->load(path, false, &loadedFileList);
loadedFileList[path]++;
//particles //particles
if(sn->hasChild("particles")) { if(sn->hasChild("particles")) {
@@ -93,12 +94,11 @@ void SkillType::load(const XmlNode *sn, const string &dir, const TechTree *tt,
sounds.resize(soundNode->getChildCount()); sounds.resize(soundNode->getChildCount());
for(int i = 0; i < soundNode->getChildCount(); ++i) { for(int i = 0; i < soundNode->getChildCount(); ++i) {
const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); const XmlNode *soundFileNode= soundNode->getChild("sound-file", i);
string path= soundFileNode->getAttribute("path")->getRestrictedValue(); string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true);
trimPathWithStartingSlash(path);
StaticSound *sound= new StaticSound(); StaticSound *sound= new StaticSound();
sound->load(currentPath + path); sound->load(path);
loadedFileList[currentPath + path]++; loadedFileList[path]++;
sounds[i]= sound; sounds[i]= sound;
} }
} }
@@ -259,12 +259,11 @@ void AttackSkillType::load(const XmlNode *sn, const string &dir, const TechTree
projSounds.resize(soundNode->getChildCount()); projSounds.resize(soundNode->getChildCount());
for(int i=0; i<soundNode->getChildCount(); ++i){ for(int i=0; i<soundNode->getChildCount(); ++i){
const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); const XmlNode *soundFileNode= soundNode->getChild("sound-file", i);
string path= soundFileNode->getAttribute("path")->getRestrictedValue(); string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true);
trimPathWithStartingSlash(path);
StaticSound *sound= new StaticSound(); StaticSound *sound= new StaticSound();
sound->load(currentPath + path); sound->load(path);
loadedFileList[currentPath + path]++; loadedFileList[path]++;
projSounds[i]= sound; projSounds[i]= sound;
} }
} }

View File

@@ -70,14 +70,14 @@ void UpgradeType::load(const string &dir, const TechTree *techTree,
//image //image
const XmlNode *imageNode= upgradeNode->getChild("image"); const XmlNode *imageNode= upgradeNode->getChild("image");
image= Renderer::getInstance().newTexture2D(rsGame); image= Renderer::getInstance().newTexture2D(rsGame);
image->load(currentPath + imageNode->getAttribute("path")->getRestrictedValue()); image->load(imageNode->getAttribute("path")->getRestrictedValue(currentPath));
loadedFileList[currentPath + imageNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[imageNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
//image cancel //image cancel
const XmlNode *imageCancelNode= upgradeNode->getChild("image-cancel"); const XmlNode *imageCancelNode= upgradeNode->getChild("image-cancel");
cancelImage= Renderer::getInstance().newTexture2D(rsGame); cancelImage= Renderer::getInstance().newTexture2D(rsGame);
cancelImage->load(currentPath + imageCancelNode->getAttribute("path")->getRestrictedValue()); cancelImage->load(imageCancelNode->getAttribute("path")->getRestrictedValue(currentPath));
loadedFileList[currentPath + imageCancelNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[imageCancelNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
//upgrade time //upgrade time
const XmlNode *upgradeTimeNode= upgradeNode->getChild("time"); const XmlNode *upgradeTimeNode= upgradeNode->getChild("time");

View File

@@ -39,64 +39,76 @@ void AmbientSounds::load(const string &dir, const XmlNode *xmlNode,
const XmlNode *dayNode= xmlNode->getChild("day-sound"); const XmlNode *dayNode= xmlNode->getChild("day-sound");
enabledDay= dayNode->getAttribute("enabled")->getBoolValue(); enabledDay= dayNode->getAttribute("enabled")->getBoolValue();
if(enabledDay) { if(enabledDay) {
path= dayNode->getAttribute("path")->getRestrictedValue();
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
day.open(currentPath + path);
path= dayNode->getAttribute("path")->getRestrictedValue(currentPath);
day.open(path);
loadedFileList[path]++;
alwaysPlayDay= dayNode->getAttribute("play-always")->getBoolValue(); alwaysPlayDay= dayNode->getAttribute("play-always")->getBoolValue();
} }
//night //night
const XmlNode *nightNode= xmlNode->getChild("night-sound"); const XmlNode *nightNode= xmlNode->getChild("night-sound");
enabledNight= nightNode->getAttribute("enabled")->getBoolValue(); enabledNight= nightNode->getAttribute("enabled")->getBoolValue();
if(enabledNight){ if(enabledNight) {
path= nightNode->getAttribute("path")->getRestrictedValue();
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
night.open(currentPath + path);
path= nightNode->getAttribute("path")->getRestrictedValue(currentPath);
night.open(path);
loadedFileList[path]++;
alwaysPlayNight= nightNode->getAttribute("play-always")->getBoolValue(); alwaysPlayNight= nightNode->getAttribute("play-always")->getBoolValue();
} }
//rain //rain
const XmlNode *rainNode= xmlNode->getChild("rain-sound"); const XmlNode *rainNode= xmlNode->getChild("rain-sound");
enabledRain= rainNode->getAttribute("enabled")->getBoolValue(); enabledRain= rainNode->getAttribute("enabled")->getBoolValue();
if(enabledRain){ if(enabledRain) {
path= rainNode->getAttribute("path")->getRestrictedValue();
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
rain.open(currentPath + path);
path= rainNode->getAttribute("path")->getRestrictedValue(currentPath);
rain.open(path);
loadedFileList[path]++;
} }
//snow //snow
const XmlNode *snowNode= xmlNode->getChild("snow-sound"); const XmlNode *snowNode= xmlNode->getChild("snow-sound");
enabledSnow= snowNode->getAttribute("enabled")->getBoolValue(); enabledSnow= snowNode->getAttribute("enabled")->getBoolValue();
if(enabledSnow){ if(enabledSnow) {
path= snowNode->getAttribute("path")->getRestrictedValue();
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
snow.open(currentPath + path);
path= snowNode->getAttribute("path")->getRestrictedValue(currentPath);
snow.open(path);
loadedFileList[path]++;
} }
//dayStart //dayStart
const XmlNode *dayStartNode= xmlNode->getChild("day-start-sound"); const XmlNode *dayStartNode= xmlNode->getChild("day-start-sound");
enabledDayStart= dayStartNode->getAttribute("enabled")->getBoolValue(); enabledDayStart= dayStartNode->getAttribute("enabled")->getBoolValue();
if(enabledDayStart){ if(enabledDayStart) {
path= dayStartNode->getAttribute("path")->getRestrictedValue();
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
dayStart.load(currentPath + path);
loadedFileList[currentPath + path]++; path= dayStartNode->getAttribute("path")->getRestrictedValue(currentPath);
dayStart.load(path);
loadedFileList[path]++;
} }
//nightStart //nightStart
const XmlNode *nightStartNode= xmlNode->getChild("night-start-sound"); const XmlNode *nightStartNode= xmlNode->getChild("night-start-sound");
enabledNightStart= nightStartNode->getAttribute("enabled")->getBoolValue(); enabledNightStart= nightStartNode->getAttribute("enabled")->getBoolValue();
if(enabledNightStart){ if(enabledNightStart) {
path= nightStartNode->getAttribute("path")->getRestrictedValue();
string currentPath = dir; string currentPath = dir;
endPathWithSlash(currentPath); endPathWithSlash(currentPath);
nightStart.load(currentPath + path);
loadedFileList[currentPath + path]++; path= nightStartNode->getAttribute("path")->getRestrictedValue(currentPath);
nightStart.load(path);
loadedFileList[path]++;
} }
} }
@@ -173,8 +185,8 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck
for(int j=0; j<childCount; ++j){ for(int j=0; j<childCount; ++j){
const XmlNode *textureNode= surfaceNode->getChild("texture", j); const XmlNode *textureNode= surfaceNode->getChild("texture", j);
surfPixmaps[i][j].init(3); surfPixmaps[i][j].init(3);
surfPixmaps[i][j].load(currentPath + textureNode->getAttribute("path")->getRestrictedValue()); surfPixmaps[i][j].load(textureNode->getAttribute("path")->getRestrictedValue(currentPath));
loadedFileList[currentPath + textureNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[textureNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
surfProbs[i][j]= textureNode->getAttribute("prob")->getFloatValue(); surfProbs[i][j]= textureNode->getAttribute("prob")->getFloatValue();
} }
@@ -201,8 +213,8 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck
for(int j=0; j<childCount; ++j) { for(int j=0; j<childCount; ++j) {
const XmlNode *modelNode= objectNode->getChild("model", j); const XmlNode *modelNode= objectNode->getChild("model", j);
const XmlAttribute *pathAttribute= modelNode->getAttribute("path"); const XmlAttribute *pathAttribute= modelNode->getAttribute("path");
objectTypes[i].loadModel(currentPath + pathAttribute->getRestrictedValue(),&loadedFileList); objectTypes[i].loadModel(pathAttribute->getRestrictedValue(currentPath),&loadedFileList);
loadedFileList[currentPath + pathAttribute->getRestrictedValue()]++; loadedFileList[pathAttribute->getRestrictedValue(currentPath)]++;
if(modelNode->hasChild("particles")){ if(modelNode->hasChild("particles")){
const XmlNode *particleNode= modelNode->getChild("particles"); const XmlNode *particleNode= modelNode->getChild("particles");
@@ -249,8 +261,8 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck
waterTex->getPixmap()->init(waterFrameCount, 4); waterTex->getPixmap()->init(waterFrameCount, 4);
for(int i=0; i<waterFrameCount; ++i){ for(int i=0; i<waterFrameCount; ++i){
const XmlNode *waterFrameNode= waterNode->getChild("texture", i); const XmlNode *waterFrameNode= waterNode->getChild("texture", i);
waterTex->getPixmap()->loadSlice(currentPath + waterFrameNode->getAttribute("path")->getRestrictedValue(), i); waterTex->getPixmap()->loadSlice(waterFrameNode->getAttribute("path")->getRestrictedValue(currentPath), i);
loadedFileList[currentPath + waterFrameNode->getAttribute("path")->getRestrictedValue()]++; loadedFileList[waterFrameNode->getAttribute("path")->getRestrictedValue(currentPath)]++;
} }
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);

View File

@@ -144,14 +144,14 @@ public:
public: public:
const string getName() const {return name;} const string getName() const {return name;}
const string getValue(string prefixValue="") const; const string getValue(string prefixValue="", bool trimValueWithStartingSlash=false) const;
bool getBoolValue() const; bool getBoolValue() const;
int getIntValue() const; int getIntValue() const;
int getIntValue(int min, int max) const; int getIntValue(int min, int max) const;
float getFloatValue() const; float getFloatValue() const;
float getFloatValue(float min, float max) const; float getFloatValue(float min, float max) const;
const string getRestrictedValue(string prefixValue="") const; const string getRestrictedValue(string prefixValue="", bool trimValueWithStartingSlash=false) const;
}; };

View File

@@ -21,14 +21,16 @@
#include "util.h" #include "util.h"
#include "types.h" #include "types.h"
#include "properties.h" #include "properties.h"
#include "platform_common.h"
#include "leak_dumper.h" #include "leak_dumper.h"
XERCES_CPP_NAMESPACE_USE XERCES_CPP_NAMESPACE_USE
using namespace std; using namespace std;
using namespace Shared::PlatformCommon;
namespace Shared{ namespace Xml{ namespace Shared { namespace Xml {
using namespace Util; using namespace Util;
@@ -428,15 +430,18 @@ float XmlAttribute::getFloatValue(float min, float max) const{
return f; return f;
} }
const string XmlAttribute::getValue(string prefixValue) const { const string XmlAttribute::getValue(string prefixValue, bool trimValueWithStartingSlash) const {
string result = value; string result = value;
if(skipRestrictionCheck == false && usesCommondata == false) { if(skipRestrictionCheck == false && usesCommondata == false) {
result = prefixValue + value; if(trimValueWithStartingSlash == true) {
trimPathWithStartingSlash(result);
}
result = prefixValue + result;
} }
return result; return result;
} }
const string XmlAttribute::getRestrictedValue(string prefixValue) const { const string XmlAttribute::getRestrictedValue(string prefixValue, bool trimValueWithStartingSlash) const {
if(skipRestrictionCheck == false && usesCommondata == false) { if(skipRestrictionCheck == false && usesCommondata == false) {
const string allowedCharacters = "abcdefghijklmnopqrstuvwxyz1234567890._-/"; const string allowedCharacters = "abcdefghijklmnopqrstuvwxyz1234567890._-/";
@@ -451,7 +456,10 @@ const string XmlAttribute::getRestrictedValue(string prefixValue) const {
string result = value; string result = value;
if(skipRestrictionCheck == false && usesCommondata == false) { if(skipRestrictionCheck == false && usesCommondata == false) {
result = prefixValue + value; if(trimValueWithStartingSlash == true) {
trimPathWithStartingSlash(result);
}
result = prefixValue + result;
} }
return result; return result;
} }