1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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 //-------------------------------------------------------------------------------------------------
22 //-------------------------------------------------------------------------------------------------
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
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();
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
);
65 typedef std::vector
<NLMISC::CSmartPtr
<ICharInfoExtractor
> > TInfoExtractors
;
66 TInfoExtractors _InfoExtractors
;
68 typedef std::vector
<NLMISC::CSmartPtr
<ICharFilter
> > TFilters
;
71 typedef std::vector
<std::string
> TFiles
;
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
;
81 typedef std::map
<std::string
,std::string
> TCurrentRowEntries
;
82 TCurrentRowEntries _CurrentRowEntries
;
84 typedef enum { INIT
, WORK
, CLOSED
, ERROR
} TState
;
87 std::string _OutputPath
;
94 //-------------------------------------------------------------------------------------------------