Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:30:08

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 LogStream.hpp
0043  *  @brief Abstract base class 'LogStream', representing an output log stream.
0044  */
0045 #pragma once
0046 #ifndef INCLUDED_AI_LOGSTREAM_H
0047 #define INCLUDED_AI_LOGSTREAM_H
0048 
0049 #ifdef __GNUC__
0050 #pragma GCC system_header
0051 #endif
0052 
0053 #include "types.h"
0054 
0055 namespace Assimp {
0056 
0057 class IOSystem;
0058 
0059 // ------------------------------------------------------------------------------------
0060 /** @brief CPP-API: Abstract interface for log stream implementations.
0061  *
0062  *  Several default implementations are provided, see #aiDefaultLogStream for more
0063  *  details. Writing your own implementation of LogStream is just necessary if these
0064  *  are not enough for your purpose. */
0065 class ASSIMP_API LogStream
0066 #ifndef SWIG
0067         : public Intern::AllocateFromAssimpHeap
0068 #endif
0069 {
0070 protected:
0071     /** @brief  Default constructor */
0072     LogStream() AI_NO_EXCEPT;
0073 
0074 public:
0075     /** @brief  Virtual destructor  */
0076     virtual ~LogStream();
0077 
0078     // -------------------------------------------------------------------
0079     /** @brief  Overwrite this for your own output methods
0080      *
0081      *  Log messages *may* consist of multiple lines and you shouldn't
0082      *  expect a consistent formatting. If you want custom formatting
0083      *  (e.g. generate HTML), supply a custom instance of Logger to
0084      *  #DefaultLogger:set(). Usually you can *expect* that a log message
0085      *  is exactly one line and terminated with a single \n character.
0086      *  @param message Message to be written */
0087     virtual void write(const char *message) = 0;
0088 
0089     // -------------------------------------------------------------------
0090     /** @brief Creates a default log stream
0091      *  @param streams Type of the default stream
0092      *  @param name For aiDefaultLogStream_FILE: name of the output file
0093      *  @param io For aiDefaultLogStream_FILE: IOSystem to be used to open the output
0094      *   file. Pass nullptr for the default implementation.
0095      *  @return New LogStream instance.  */
0096     static LogStream *createDefaultStream(aiDefaultLogStream stream,
0097             const char *name = "AssimpLog.txt",
0098             IOSystem *io = nullptr);
0099 
0100 }; // !class LogStream
0101 
0102 inline LogStream::LogStream() AI_NO_EXCEPT = default;
0103 
0104 inline LogStream::~LogStream() = default;
0105 
0106 } // Namespace Assimp
0107 
0108 #endif // INCLUDED_AI_LOGSTREAM_H