summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/assimp/contrib/openddlparser/code/OpenDDLExport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/assimp/contrib/openddlparser/code/OpenDDLExport.cpp')
-rw-r--r--src/3rdparty/assimp/contrib/openddlparser/code/OpenDDLExport.cpp63
1 files changed, 4 insertions, 59 deletions
diff --git a/src/3rdparty/assimp/contrib/openddlparser/code/OpenDDLExport.cpp b/src/3rdparty/assimp/contrib/openddlparser/code/OpenDDLExport.cpp
index 2e73ea470..e45fb041a 100644
--- a/src/3rdparty/assimp/contrib/openddlparser/code/OpenDDLExport.cpp
+++ b/src/3rdparty/assimp/contrib/openddlparser/code/OpenDDLExport.cpp
@@ -29,60 +29,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
BEGIN_ODDLPARSER_NS
-StreamFormatterBase::StreamFormatterBase() {
-
-}
-
-StreamFormatterBase::~StreamFormatterBase() {
-
-}
-
-std::string StreamFormatterBase::format( const std::string &statement ) {
- std::string tmp( statement );
- return tmp;
-}
-
-IOStreamBase::IOStreamBase( StreamFormatterBase *formatter )
-: m_formatter( formatter )
-, m_file( ddl_nullptr ) {
- if (ddl_nullptr == m_formatter) {
- m_formatter = new StreamFormatterBase;
- }
-}
-
-IOStreamBase::~IOStreamBase() {
- delete m_formatter;
- m_formatter = ddl_nullptr;
-}
-
-bool IOStreamBase::open( const std::string &name ) {
- m_file = ::fopen( name.c_str(), "a" );
- if (m_file == ddl_nullptr) {
- return false;
- }
-
- return true;
-}
-
-bool IOStreamBase::close() {
- if (ddl_nullptr == m_file) {
- return false;
- }
-
- ::fclose( m_file );
- m_file = ddl_nullptr;
-
- return true;
-}
-
-size_t IOStreamBase::write( const std::string &statement ) {
- if (ddl_nullptr == m_file) {
- return 0;
- }
- std::string formatStatement = m_formatter->format( statement );
- return ::fwrite( formatStatement.c_str(), sizeof( char ), formatStatement.size(), m_file );
-}
-
struct DDLNodeIterator {
const DDLNode::DllNodeList &m_childs;
size_t m_idx;
@@ -189,10 +135,9 @@ bool OpenDDLExport::writeToStream( const std::string &statement ) {
}
bool OpenDDLExport::writeNode( DDLNode *node, std::string &statement ) {
- bool success( true );
writeNodeHeader( node, statement );
if (node->hasProperties()) {
- success |= writeProperties( node, statement );
+ writeProperties( node, statement );
}
writeLineEnd( statement );
@@ -280,7 +225,7 @@ bool OpenDDLExport::writeValueType( Value::ValueType type, size_t numItems, std:
statement += "[";
char buffer[ 256 ];
::memset( buffer, '\0', 256 * sizeof( char ) );
- sprintf( buffer, "%d", int(numItems) );
+ sprintf( buffer, "%d", static_cast<int>( numItems ) );
statement += buffer;
statement += "]";
}
@@ -414,11 +359,10 @@ bool OpenDDLExport::writeValueArray( DataArrayList *al, std::string &statement )
}
DataArrayList *nextDataArrayList = al ;
- Value *nextValue( nextDataArrayList->m_dataList );
while (ddl_nullptr != nextDataArrayList) {
if (ddl_nullptr != nextDataArrayList) {
statement += "{ ";
- nextValue = nextDataArrayList->m_dataList;
+ Value *nextValue( nextDataArrayList->m_dataList );
size_t idx( 0 );
while (ddl_nullptr != nextValue) {
if (idx > 0) {
@@ -437,3 +381,4 @@ bool OpenDDLExport::writeValueArray( DataArrayList *al, std::string &statement )
}
END_ODDLPARSER_NS
+