-// Copyright (C) 2009 - 2010 Mathias Froehlich - Mathias.Froehlich@web.de
+// Copyright (C) 2009 - 2011 Mathias Froehlich - Mathias.Froehlich@web.de
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
namespace simgear {
HLAArrayDataType::HLAArrayDataType(const std::string& name) :
- HLADataType(name)
+ HLADataType(name),
+ _isOpaque(false),
+ _isString(false)
{
}
_elementDataType = elementDataType;
}
+void
+HLAArrayDataType::setIsOpaque(bool isOpaque)
+{
+ _isOpaque = isOpaque;
+}
+
+void
+HLAArrayDataType::setIsString(bool isString)
+{
+ _isString = isString;
+}
+
///////////////////////////////////////////////////////////////////////////////////
HLAFixedArrayDataType::HLAFixedArrayDataType(const std::string& name) :
-// Copyright (C) 2009 - 2010 Mathias Froehlich - Mathias.Froehlich@web.de
+// Copyright (C) 2009 - 2011 Mathias Froehlich - Mathias.Froehlich@web.de
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
const HLADataType* getElementDataType() const
{ return _elementDataType.get(); }
+ void setIsOpaque(bool isOpaque);
+ bool getIsOpaque() const
+ { return _isOpaque; }
+
+ void setIsString(bool isString);
+ bool getIsString() const
+ { return _isString; }
+
private:
SGSharedPtr<const HLADataType> _elementDataType;
+ bool _isOpaque;
+ bool _isString;
};
class HLAFixedArrayDataType : public HLAArrayDataType {
-// Copyright (C) 2009 - 2010 Mathias Froehlich - Mathias.Froehlich@web.de
+// Copyright (C) 2009 - 2011 Mathias Froehlich - Mathias.Froehlich@web.de
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
}
arrayDataType->setElementDataType(elementDataType.get());
+ // Check if this should be a string data type
+ if (elementDataType->toBasicDataType()) {
+ if (dataTypeName == "HLAopaqueData") {
+ arrayDataType->setIsOpaque(true);
+ } else if (dataTypeName.find("String") != std::string::npos || dataTypeName.find("string") != std::string::npos) {
+ arrayDataType->setIsString(true);
+ }
+ }
+
return arrayDataType;
}