|
|
|||
File indexing completed on 2026-01-03 09:35:12
0001 /* 0002 Open Asset Import Library (assimp) 0003 ---------------------------------------------------------------------- 0004 0005 Copyright (c) 2006-2025, 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 #pragma once 0043 #ifndef INCLUDED_ASSIMP_XML_TOOLS_H 0044 #define INCLUDED_ASSIMP_XML_TOOLS_H 0045 0046 #ifdef __GNUC__ 0047 # pragma GCC system_header 0048 #endif 0049 0050 #include <string> 0051 0052 namespace Assimp { 0053 // XML escape the 5 XML special characters (",',<,> and &) in |data| 0054 // Based on http://stackoverflow.com/questions/5665231 0055 std::string XMLEscape(const std::string& data) { 0056 std::string buffer; 0057 0058 const size_t size = data.size(); 0059 buffer.reserve(size + size / 8); 0060 for(size_t i = 0; i < size; ++i) { 0061 const char c = data[i]; 0062 switch(c) { 0063 case '&' : 0064 buffer.append("&"); 0065 break; 0066 case '\"': 0067 buffer.append("""); 0068 break; 0069 case '\'': 0070 buffer.append("'"); 0071 break; 0072 case '<' : 0073 buffer.append("<"); 0074 break; 0075 case '>' : 0076 buffer.append(">"); 0077 break; 0078 default: 0079 buffer.append(&c, 1); 0080 break; 0081 } 0082 } 0083 return buffer; 0084 } 0085 } 0086 0087 #endif // INCLUDED_ASSIMP_XML_TOOLS_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|