![]() |
|
|||
File indexing completed on 2025-02-21 09:30:10
0001 /* 0002 Open Asset Import Library (assimp) 0003 ---------------------------------------------------------------------- 0004 0005 Copyright (c) 2006-2024, assimp team 0006 0007 All rights reserved. 0008 0009 Redistribution and use of this software in source and binary forms, 0010 with or without modification, are permitted provided that the 0011 following conditions are met: 0012 0013 * Redistributions of source code must retain the above 0014 copyright notice, this list of conditions and the 0015 following disclaimer. 0016 0017 * Redistributions in binary form must reproduce the above 0018 copyright notice, this list of conditions and the 0019 following disclaimer in the documentation and/or other 0020 materials provided with the distribution. 0021 0022 * Neither the name of the assimp team, nor the names of its 0023 contributors may be used to endorse or promote products 0024 derived from this software without specific prior 0025 written permission of the assimp team. 0026 0027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 0028 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 0029 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 0030 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 0031 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 0032 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 0033 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 0034 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 0035 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 0036 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 0037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0038 0039 ---------------------------------------------------------------------- 0040 */ 0041 0042 /** @file Declares a helper class, "CommentRemover", which can be 0043 * used to remove comments (single and multi line) from a text file. 0044 */ 0045 #pragma once 0046 #ifndef AI_REMOVE_COMMENTS_H_INC 0047 #define AI_REMOVE_COMMENTS_H_INC 0048 0049 #ifdef __GNUC__ 0050 # pragma GCC system_header 0051 #endif 0052 0053 #include <assimp/defs.h> 0054 0055 namespace Assimp { 0056 0057 // --------------------------------------------------------------------------- 0058 /** \brief Helper class to remove single and multi line comments from a file 0059 * 0060 * Some mesh formats like MD5 have comments that are quite similar 0061 * to those in C or C++ so this code has been moved to a separate 0062 * module. 0063 */ 0064 class ASSIMP_API CommentRemover { 0065 // class cannot be instanced 0066 CommentRemover() {} 0067 0068 public: 0069 0070 //! Remove single-line comments. The end of a line is 0071 //! expected to be either NL or CR or NLCR. 0072 //! \param szComment The start sequence of the comment, e.g. "//" 0073 //! \param szBuffer Buffer to work with 0074 //! \param chReplacement Character to be used as replacement 0075 //! for commented lines. By default this is ' ' 0076 static void RemoveLineComments(const char* szComment, 0077 char* szBuffer, char chReplacement = ' '); 0078 0079 //! Remove multi-line comments. The end of a line is 0080 //! expected to be either NL or CR or NLCR. Multi-line comments 0081 //! may not be nested (as in C). 0082 //! \param szCommentStart The start sequence of the comment, e.g. "/*" 0083 //! \param szCommentEnd The end sequence of the comment, e.g. "*/" 0084 //! \param szBuffer Buffer to work with 0085 //! \param chReplacement Character to be used as replacement 0086 //! for commented lines. By default this is ' ' 0087 static void RemoveMultiLineComments(const char* szCommentStart, 0088 const char* szCommentEnd,char* szBuffer, 0089 char chReplacement = ' '); 0090 }; 0091 } // ! Assimp 0092 0093 #endif // !! AI_REMOVE_COMMENTS_H_INC
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |