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/>.
19 #ifndef RY_PRIMITIVES_PARSER_H
20 #define RY_PRIMITIVES_PARSER_H
22 #include "nel/misc/types_nl.h"
23 #include "nel/misc/singleton.h"
24 #include "nel/ligo/primitive.h"
25 #include "nel/ligo/ligo_config.h"
28 * Singleton used to do all the generic parsing job on primitive file
29 * \author Nicolas Brigand
30 * \author Nevrax France
33 class CPrimitivesParser
: public NLMISC::CSingleton
<CPrimitivesParser
>
37 struct TLoadedPrimitive
39 NLLIGO::CPrimitives Primitive
;
43 typedef std::list
< TLoadedPrimitive
> TPrimitivesList
;
45 ///\return the primitives
46 inline const TPrimitivesList
& getPrimitives(){ return _Primitives
; }
47 ///\return the primitives file names
48 // inline const std::vector< std::string > & getPrimitiveFiles(){ return _PrimitiveFiles; }
52 static bool getAlias(const NLLIGO::IPrimitive
*prim
, uint32
&alias
);
54 static std::string
aliasToString(uint32 alias
);
55 static uint32
aliasFromString(const std::string
& alias
);
57 static uint32
aliasGetStaticPart(uint32 alias
);
59 static uint32
aliasGetDynamicPart(uint32 alias
);
66 * load a primitive files in the specified CPrimitives class
67 * \return true if the parsing was correctly made
69 bool loadPrimitive(const char* fileName
,NLLIGO::CPrimitives
& primitives
);
72 TPrimitivesList _Primitives
;
73 /// Parsed primitive file names
74 // std::vector<std::string> _PrimitiveFiles;
76 static bool _LigoInit
;
78 static NLLIGO::CLigoConfig _LigoConfig
;
82 #endif // RY_PRIMITIVES_PARSER_H
84 /* End of primitives_parser.h */