Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp::CommentRemover Class Reference

Helper class to remove single and multi line comments from a file. More...

#include <RemoveComments.h>

Static Public Member Functions

static void RemoveLineComments (const char *szComment, char *szBuffer, char chReplacement=' ')
 Remove single-line comments. More...
 
static void RemoveMultiLineComments (const char *szCommentStart, const char *szCommentEnd, char *szBuffer, char chReplacement=' ')
 Remove multi-line comments. More...
 

Detailed Description

Helper class to remove single and multi line comments from a file.

Some mesh formats like MD5 have comments that are quite similar to those in C or C++ so this code has been moved to a separate module.

Member Function Documentation

◆ RemoveLineComments()

static void Assimp::CommentRemover::RemoveLineComments ( const char *  szComment,
char *  szBuffer,
char  chReplacement = ' ' 
)
static

Remove single-line comments.

The end of a line is expected to be either NL or CR or NLCR.

Parameters
szCommentThe start sequence of the comment, e.g. "//"
szBufferBuffer to work with
chReplacementCharacter to be used as replacement for commented lines. By default this is ' '

◆ RemoveMultiLineComments()

static void Assimp::CommentRemover::RemoveMultiLineComments ( const char *  szCommentStart,
const char *  szCommentEnd,
char *  szBuffer,
char  chReplacement = ' ' 
)
static

Remove multi-line comments.

The end of a line is expected to be either NL or CR or NLCR. Multi-line comments may not be nested (as in C).

Parameters
szCommentStartThe start sequence of the comment, e.g. "/*"
szCommentEndThe end sequence of the comment, e.g. "*&zwj;/"
szBufferBuffer to work with
chReplacementCharacter to be used as replacement for commented lines. By default this is ' '

The documentation for this class was generated from the following file: