[BACK] Return to io_interface.cpp CVS log [TXT][DIR] Up to Nevrax / code / nelns / agent_service

File: Nevrax / code / nelns / agent_service / Attic / io_interface.cpp (download)
Revision 1.1, Wed Apr 18 13:54:25 2001 UTC (15 months, 1 week ago) by valignat
Branch: MAIN
RENAMED code/server to code/nelns.

#include "nel/ai/agent/agent.h"
#include "io_interface.h"
#include <stdio.h>
#include <stdarg.h>

namespace SRV
{
        extern std::fstream logStream;
        extern bool logFileState;

        static char LaseErrorCodeOrdreInterprete[32*1024];
        void IOTrace::Echo(char *str, ...)
        {
                char        temp[32*1024];                
                va_list argument;
                va_start (argument, str);        
                
                vsprintf(temp, str, argument);                
                strcpy(LaseErrorCodeOrdreInterprete,temp);

#ifdef NL_DEBUG                 
                printf("%s",LaseErrorCodeOrdreInterprete);                
                if(logFileState && logStream.is_open())
                {
                        logStream << LaseErrorCodeOrdreInterprete;
                        logStream.flush();
                }
#else
                printf("%s",LaseErrorCodeOrdreInterprete);
                if(logFileState && logStream.is_open())
                {
                        logStream << LaseErrorCodeOrdreInterprete;
                        logStream.flush();
                }
#endif
                        
        }
        
        const std::string IOTrace::InPut()
        {
                std::string str;
                /*char toto[4096];
                str = gets(toto);*/
                cin >> str;
                return str;
        }

        const NLAIC::CIdentType &IOTrace::getType() const
        {        
                static const NLAIC::CIdentType idIOWinInterface("IOWinInterface",        NLAIC::CSelfClassFactory(*this),
                                                                                                                                                NLAIC::CTypeOfObject(NLAIC::CTypeOfObject::tObject),NLAIC::CTypeOfOperator(0));
                return idIOWinInterface;
        }
}