Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / tools / stats_scan / character_scan_job.h
blob92507611412e6ebc34ba05e9127275eca9d8c6a6
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef CHARACTER_SCAN_JOB_H
18 #define CHARACTER_SCAN_JOB_H
20 //-------------------------------------------------------------------------------------------------
21 // includes
22 //-------------------------------------------------------------------------------------------------
24 #include "stdio.h"
26 #include "game_share/file_description_container.h"
28 #include "job_manager.h"
29 #include "char_info_extractor_factory.h"
30 #include "char_filter_factory.h"
33 //-------------------------------------------------------------------------------------------------
34 // class CCharacterScanJob
35 //-------------------------------------------------------------------------------------------------
37 class CCharacterScanJob: public CJobManager::IJob
39 public:
40 // inherited virtual interface
41 virtual bool finished();
42 virtual std::string getShortStatus();
43 virtual std::string getStatus();
44 virtual void display(NLMISC::CLog* log=NLMISC::InfoLog);
45 virtual void update();
47 public:
48 CCharacterScanJob();
49 ~CCharacterScanJob();
51 public:
52 // interface for initialisation and configuration of the job
53 bool charTblAddCol(const std::string& name);
54 bool addInfoExtractor(ICharInfoExtractor* infoExtractor);
55 bool addFilter(ICharFilter* filter);
56 bool addFiles(const CFileDescriptionContainer& fdc);
57 bool setOutputPath(const std::string& path);
59 // interface for the InfoExtractors to use
60 void charTblSetEntry(const std::string& colName,const std::string& value);
61 void charTblFlushRow(uint32 account,uint32 slot);
62 void freqTblAddEntry(const std::string& tblName, const std::string& key);
64 private:
65 typedef std::vector<NLMISC::CSmartPtr<ICharInfoExtractor> > TInfoExtractors;
66 TInfoExtractors _InfoExtractors;
68 typedef std::vector<NLMISC::CSmartPtr<ICharFilter> > TFilters;
69 TFilters _Filters;
71 typedef std::vector<std::string> TFiles;
72 TFiles _Files;
74 typedef std::map<std::string,uint32> TCharStatsMapTbl;
75 typedef std::map<std::string, TCharStatsMapTbl> TCharStatsMap;
76 TCharStatsMap _CharStatsMap;
78 typedef std::vector<std::string> TTblCols;
79 TTblCols _TblCols;
81 typedef std::map<std::string,std::string> TCurrentRowEntries;
82 TCurrentRowEntries _CurrentRowEntries;
84 typedef enum { INIT, WORK, CLOSED, ERROR } TState;
85 TState _State;
87 std::string _OutputPath;
89 FILE* _CharTblFile;
90 uint32 _NextFile;
94 //-------------------------------------------------------------------------------------------------
95 #endif