aboutsummaryrefslogtreecommitdiff
path: root/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/io_interface.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html
blob: 2cfd6fb45de3379d3944fc6ff27945db364bf35e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#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;
	}
}