streamstatushandler.cpp

来自「2009 ROBOCUP 仿真2DSERVER 源码」· C++ 代码 · 共 154 行

CPP
154
字号
// -*-c++-*-/***************************************************************************                         streamstatushandler.cpp        Implementation for writing parser notifactions to streams                             -------------------    begin                : 14-MAY-2003    copyright            : (C) 2003 by The RoboCup Soccer Server                           Maintenance Group.    email                : sserver-admin@lists.sourceforge.net***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU LGPL as published by the Free Software  * *   Foundation; either version 2 of the License, or (at your option) any  * *   later version.                                                        * *                                                                         * ***************************************************************************/#include "streamstatushandler.hpp"#include <iostream>#include <cstring>namespace rcss {namespace conf {StreamStatusHandler::StreamStatusHandler()    : M_errstrm( std::cerr ){}StreamStatusHandler::StreamStatusHandler( std::ostream & errstrm )    : M_errstrm( errstrm ){}StreamStatusHandler::~StreamStatusHandler(){}voidStreamStatusHandler::parseError( const std::string & curr,                                 const std::string & err,                                 const std::string & name,                                 int lineno ){    M_errstrm << name << ": "              << lineno              << ": error: while parsing \"" << curr << "\"\n";    M_errstrm << name << ": "              << lineno              << ": error: " << err << std::endl;}voidStreamStatusHandler::buildError( const std::string & module_name,                                 const std::string & param_name,                                 const std::string & error,                                 const std::string & name,                                 int lineno ){    M_errstrm << name << ": "              << lineno              << ": error: while parsing \"" << module_name              << "::" << param_name << "\"\n"              << name << ": "              << lineno              << ": error: " << error << std::endl;}voidStreamStatusHandler::buildWarning( const std::string & module_name,                                   const std::string & param_name,                                   const std::string & warning,                                   const std::string & name,                                   int lineno ){    M_errstrm << name << ": "              << lineno              << ": warning: while parsing \"" << module_name              << "::" << param_name << "\"\n"              << name << ": " << lineno              << ": warning: " << warning << std::endl;}voidStreamStatusHandler::creatingConfFile( const std::string & conf_name ){    M_errstrm << "Trying to create configuration file: "              << conf_name << std::endl;}voidStreamStatusHandler::createdConfFile( const std::string & conf_name ){    M_errstrm << "Created configuration file: "              << conf_name << std::endl;}voidStreamStatusHandler::confCreationFailed( const std::string & conf_name,                                         int error ){    M_errstrm << conf_name              << ": Configuration file creation failed: "              << strerror( error ) << std::endl;}voidStreamStatusHandler::includeFailed( const std::string & filename,                                    const std::string & error,                                    const std::string & name,                                    int lineno ){    M_errstrm << name << ": " << lineno              << ": error: include '" << filename << "' failed\n";    M_errstrm << name << ": " << lineno              << ": error: " << error << std::endl;}voidStreamStatusHandler::loadFailed( const std::string & libname,                                 const std::string & error,                                 const std::vector< boost::filesystem::path > & avail,                                 const std::string & name,                                 int lineno ){    M_errstrm << name << ": " << lineno << ": error: loading '" << libname << "' failed\n";    M_errstrm << name << ": " << lineno << ": error: " << error << std::endl;    if ( avail.empty() )    {				M_errstrm << name << ": " << lineno << ": error: no available modules\n";    }    else    {				M_errstrm << name << ": " << lineno << ": error: available modules:\n";				for( std::vector< boost::filesystem::path >::const_iterator i = avail.begin();             i != avail.end(); ++i )				{            M_errstrm << "\t" << i->native_file_string() << std::endl;				}    }}}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?