File tree Expand file tree Collapse file tree 4 files changed +13
-38
lines changed Expand file tree Collapse file tree 4 files changed +13
-38
lines changed Original file line number Diff line number Diff line change 2020 </ItemGroup >
2121 <ItemGroup >
2222 <ClCompile Include =" src\Main.cpp" />
23+ <ClCompile Include =" src\Static.cpp" />
2324 </ItemGroup >
2425 <PropertyGroup Label =" Globals" >
2526 <VCProjectVersion >16.0</VCProjectVersion >
Original file line number Diff line number Diff line change 1818 <ClCompile Include =" src\Main.cpp" >
1919 <Filter >Fichiers sources</Filter >
2020 </ClCompile >
21+ <ClCompile Include =" src\Static.cpp" >
22+ <Filter >Fichiers sources</Filter >
23+ </ClCompile >
2124 </ItemGroup >
2225</Project >
Original file line number Diff line number Diff line change 11#include < iostream>
22
3- class Log
4- {
5- public:
6- const int LogLevelError = 0 ;
7- const int LogLevelWarning = 1 ;
8- const int LogLevelInfo = 2 ;
9-
10- private:
11- int m_LogLevel = LogLevelInfo;
12-
13- public:
14- void SetLevel (int level)
15- {
16- m_LogLevel = level;
17- }
18-
19- void Error (const char * message)
20- {
21- if (m_LogLevel >= LogLevelError)
22- std::cout << " [ERROR]:" << message << std::endl;
23- }
24-
25- void Warn (const char * message)
26- {
27- if (m_LogLevel >= LogLevelWarning)
28- std::cout << " [WARNING]:" << message << std::endl;
29- }
3+ extern int s_Variable;
304
31- void Info (const char * message)
32- {
33- if (m_LogLevel >= LogLevelInfo)
34- std::cout << " [INFO]:" << message << std::endl;
35- }
36- };
5+ void Function ();
376
387int main ()
398{
40- Log log;
41- log.SetLevel (log.LogLevelError );
42- log.Warn (" Hello!" );
43- log.Error (" Hello!" );
44- log.Info (" Hello!" );
9+ std::cout << s_Variable << std::endl;
4510 std::cin.get ();
4611}
Original file line number Diff line number Diff line change 1+ int s_Variable = 5 ;
2+
3+ static void Function ()
4+ {
5+
6+ }
You can’t perform that action at this time.
0 commit comments