check binary or not in ParseHeader in PlyParser

pull/218/head
YoheiKakiuchi 2014-02-07 10:38:49 +09:00
parent 52916b094c
commit 8e35ea59d5
2 changed files with 8 additions and 7 deletions

View File

@ -427,7 +427,7 @@ bool PLY::DOM::SkipComments (const char* pCur,
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
bool PLY::DOM::ParseHeader (const char* pCur,const char** pCurOut) bool PLY::DOM::ParseHeader (const char* pCur,const char** pCurOut,bool p_bBE)
{ {
ai_assert(NULL != pCur && NULL != pCurOut); ai_assert(NULL != pCur && NULL != pCurOut);
DefaultLogger::get()->debug("PLY::DOM::ParseHeader() begin"); DefaultLogger::get()->debug("PLY::DOM::ParseHeader() begin");
@ -458,9 +458,10 @@ bool PLY::DOM::ParseHeader (const char* pCur,const char** pCurOut)
SkipLine(&pCur); SkipLine(&pCur);
} }
} }
// Is this needed ? it can't work as expected, if binary data start with values as space or line end. if(!p_bBE)
// SkipSpacesAndLineEnd(pCur,&pCur); { // it would occur an error, if binary data start with values as space or line end.
*pCurOut = pCur; SkipSpacesAndLineEnd(pCur,&pCur);
}
DefaultLogger::get()->debug("PLY::DOM::ParseHeader() succeeded"); DefaultLogger::get()->debug("PLY::DOM::ParseHeader() succeeded");
return true; return true;
@ -528,7 +529,7 @@ bool PLY::DOM::ParseInstanceBinary (const char* pCur,DOM* p_pcOut,bool p_bBE)
DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() begin"); DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() begin");
if(!p_pcOut->ParseHeader(pCur,&pCur)) if(!p_pcOut->ParseHeader(pCur,&pCur,p_bBE))
{ {
DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() failure"); DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() failure");
return false; return false;
@ -551,7 +552,7 @@ bool PLY::DOM::ParseInstance (const char* pCur,DOM* p_pcOut)
DefaultLogger::get()->debug("PLY::DOM::ParseInstance() begin"); DefaultLogger::get()->debug("PLY::DOM::ParseInstance() begin");
if(!p_pcOut->ParseHeader(pCur,&pCur)) if(!p_pcOut->ParseHeader(pCur,&pCur,false))
{ {
DefaultLogger::get()->debug("PLY::DOM::ParseInstance() failure"); DefaultLogger::get()->debug("PLY::DOM::ParseInstance() failure");
return false; return false;

View File

@ -434,7 +434,7 @@ private:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
//! Handle the file header and read all element descriptions //! Handle the file header and read all element descriptions
bool ParseHeader (const char* pCur,const char** pCurOut); bool ParseHeader (const char* pCur,const char** pCurOut, bool p_bBE);
// ------------------------------------------------------------------- // -------------------------------------------------------------------
//! Read in all element instance lists //! Read in all element instance lists