📄 ilogfile.h
字号:
#ifndef FMELOGFILE_H
#define FMELOGFILE_H
// $Id: ilogfile.h,v 17.0 2005/10/28 21:08:31 geh Exp $
/*! \file ilogfile.h
\brief Defines the IFMELogFile interface.
*/
/*! \internal
============================================================================
Name : ilogfile.h
System : FME Developer Kit
Language : C++
Purpose : Declaration of IFMELogFile
Author Date Changes made
------------------ ------------ -------------------------------
Dale Lutz Jul 22, 1997 Original definition
Don Murray Jun 03, 1999 Added logMessageString method.
Kevin Wiebe Aug 12, 1999 Added activityMessage
Don Murray Oct 11, 1999 Added setCallBack, and setFileName
methods.
Kevin Wiebe Jul 04, 2000 Added getFileName & silent
Tom Weir Jun 01, 2004 Fixed documentation.
Kaustav Mukherjee Nov 16, 2004 Added the internal tag to hide this revision control part.
Khalid Khan Mar 02, 2005 Added getSilent() method
Copyright (c) 1994 - 2005, Safe Software Inc.
All Rights Reserved
This software may not be copied or reproduced, in all or in part,
without the prior written consent of Safe Software Inc.
The entire risk as to the results and performance of the software,
supporting text and other information contained in this file
(collectively called the "Software") is with the user. Although
Safe Software Incorporated has used considerable efforts in preparing
the Software, Safe Software Incorporated does not warrant the
accuracy or completeness of the Software. In no event will Safe Software
Incorporated be liable for damages, including loss of profits or
consequential damages, arising out of the use of the Software.
*/
/*! \class IFMELogFile
\brief Log file class
This file defines the interface that subclasses of this class MUST
follow.
Developers MUST NOT implement their own subclasses of this, instead,
the FME will ALWAYS provide them with the subclass instance they
should be using.
*/
#include "fmetypes.h"
class IFMEFeature;
//===========================================================================
// Abstract Interface Class -- all methods are virtual and it has no data
class IFMELogFile
{
public:
// -----------------------------------------------------------------------
/*! This method logs a message to the FME session log file.
// The messageNumber is the index of the message, which is stored
// in a file in the FME's "messages" directory. The messageParameters supply
// the values for the fill-in parameters (%0, %1, %2, ...) of the message. */
virtual void logMessage(const FME_MsgNum messageNumber,
const IFMEStringArray& messageParameters,
const FME_MsgLevel severity = FME_INFORM) = 0;
// -----------------------------------------------------------------------
/*! This method provides a quick means of logging a message to the FME
// session log file for messages that do not require any parameters.
// The messageNumber is the index of the message, which is stored
// in a file in the FME's "messages" directory. */
virtual void logMessage(const FME_MsgNum messageNumber,
const FME_MsgLevel severity = FME_INFORM) = 0;
// -----------------------------------------------------------------------
/*! This method logs the feature to the logfile. No changes are made to
// the feature.
// The maxCoords parameter controls how many coordinates will be output.
// If it is -1, then all the coordinates will be output. */
virtual void logFeature(const IFMEFeature& feature,
const FME_MsgLevel severity = FME_INFORM,
const FME_Int32 maxCoords = 20) = 0;
// -----------------------------------------------------------------------
/*! This method logs a simple string to the logfile. */
virtual void logMessageString(const char* message,
const FME_MsgLevel severity = FME_INFORM) = 0;
// -----------------------------------------------------------------------
/*! This method provides and activity feedback message to command line users.
// It should be called to output any kind of dots or numbers or whatever
// should be output to standard out WHEN we are NOT logging to standard
// output. It should be used ANYWHERE that 'cout' would otherwise be used
// to provide activity information to command line users. To enable this
// functionality, the session object must be initialized with the
// LOG_ENABLE_STDOUT directive with a value of "yes" */
virtual void activityMessage(const char* msg) = 0;
// -----------------------------------------------------------------------
/*! This methods provides FME with a callback function that will be called
// whenever a message is logged. By default, messages will be logged to
// both the callback and the FME Session log file. If the setFileName
// method is called with a NULL filename parameter, then messages will only
// be sent to the callback.
//
// This method should be called with NULL pointer in order to stop the
// callback from being called. */
virtual void setCallBack(FME_LogCallbackFunc func) = 0;
// -----------------------------------------------------------------------
/*! This method changes the file being used for logging.
// If the filename is different than the current file, then the current
// file is closed, and the new one is opened.
// If append is FME_TRUE, then new log messages will appended to the end of
// the file, otherwise the file will be cleared before any new log messages
// are added. If the file doesn't exist, a new file will be created.
//
// If a callback is being used for logging, then the filename may be set
// to NULL (append will be ignored). This will result in messages only being
// sent to the callback. */
virtual FME_MsgNum setFileName(const char* fileName,
const FME_Boolean append) = 0;
// -----------------------------------------------------------------------
/*! This method informs FME whether or not log messages should be held.
// If called with an FME_TRUE flag, then any log messages will be stored
// to an internal memory buffer for later retrieval, and no messages will
// be written to the log file, or sent to the callback(if enabled).
// If called with an FME_FALSE flag, then log messages will once again be
// written to the log file & sent to the callback (if enabled).
//
// Held messages are retained until they are retrieved using the
// getHeldMessages method. I.e. the messages will be retained even if
// holdMessages is called with an FME_FALSE parameter.
//
// By default, all messages are not held. */
virtual void holdMessages(const FME_Boolean holdMessages) = 0;
// -----------------------------------------------------------------------
/*! This method retrieves any held messages.
// After this method returns the held messages, the held messages buffer
// is cleared. */
virtual void getHeldMessages(IFMEStringArray& messages) = 0;
// -----------------------------------------------------------------------
/*! This method gets the name of the file that is currently being used to
// log messages. */
virtual const char* getFileName() = 0;
// -----------------------------------------------------------------------
/*! This routine sets the "silent" status of the logfile.
// If in silent mode, then nothing is ever logged. */
virtual void silent(FME_Boolean silent) = 0;
//------------------------------------------------------------------
// This routine retrieves the "silent" status of the logfile.
virtual FME_Boolean getSilent() = 0;
protected:
// -----------------------------------------------------------------------
// No one should be creating an instance of this directly, so we
// make the constructor protected.
IFMELogFile() {};
// -----------------------------------------------------------------------
// Destructor -- does nothing
virtual ~IFMELogFile() {};
private:
// Hide methods that we don't want called.
// -----------------------------------------------------------------------
// copy constructor
IFMELogFile(const IFMELogFile&);
// -----------------------------------------------------------------------
// assignment operator.
IFMELogFile& operator=(const IFMELogFile&);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -