- 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

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