/[Sims3RigEditor]/trunk/gr2lib_cpp/grannyfile.cpp
ViewVC logotype

Annotation of /trunk/gr2lib_cpp/grannyfile.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (hide annotations) (download)
Sat Jul 31 09:33:11 2010 UTC (10 years ago) by william
File size: 1510 byte(s)
Added support to write Granny2 Log out to a file, as well as fully implement the logging callback

1 william 5 #include "StdAfx.h"
2     #include "grannyfile.h"
3    
4     namespace gr2lib
5     {
6     namespace core
7     {
8 william 7 void __cdecl Callback(granny_log_message_type Type, granny_log_message_origin Origin, char const * Message, void * UserData);
9     void __cdecl Callback(granny_log_message_type Type, granny_log_message_origin Origin, char const * Message, void * UserData)
10 william 6 {
11     assert(Message);
12     }
13 william 12 grannyfile::grannyfile()
14     {
15     GrannyAPIVersion = new apiversion::granny2apiversion();
16     _logger = new GrannyAPILogger();
17     _GrannyFilename = "";
18     }
19 william 5 grannyfile::grannyfile(const char* filename)
20     {
21     GrannyAPIVersion = new apiversion::granny2apiversion();
22 william 12 _logger = new GrannyAPILogger();
23 william 8 _GrannyFilename = filename;
24 william 5 grannyfile::parse_granny_file();
25    
26     }
27     grannyfile::grannyfile(const char* filename,granny_int32x ExpectedMajor, granny_int32x ExpectedMinor, granny_int32x ExpectedCustomization, granny_int32x ExpectedBuild)
28     {
29     GrannyAPIVersion = new apiversion::granny2apiversion(ExpectedMajor,ExpectedMinor,ExpectedCustomization,ExpectedBuild);
30 william 12 _logger = new GrannyAPILogger();
31 william 5 _GrannyFilename = filename;
32     grannyfile::parse_granny_file();
33     }
34     void grannyfile::parse_granny_file()
35 william 12 {
36     _logger->SetLogFileName(_GrannyFilename);
37 william 5 _grn_file = GrannyReadEntireFile(_GrannyFilename);
38     if (_grn_file != 0)
39     {
40     GrannyFileInfo = GrannyGetFileInfo(_grn_file);
41     }
42     }
43     const char* grannyfile::GrannyFilename()
44     {
45     return _GrannyFilename;
46     }
47     }
48     }

  ViewVC Help
Powered by ViewVC 1.1.22