forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.h
62 lines (51 loc) · 2.73 KB
/
configuration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// --------------------------------------------------------------------------------------------------
// configuration.h
//
//
// Access and update configuration values, falling back on legacy CLRConfig methods where necessary.
//
// --------------------------------------------------------------------------------------------------
#include "clrconfig.h"
#ifndef __configuration_h__
#define __configuration_h__
class Configuration
{
public:
static void InitializeConfigurationKnobs(int numberOfConfigs, LPCWSTR *configNames, LPCWSTR *configValues);
// Returns (in priority order):
// - The value of the ConfigDWORDInfo if it's set
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul).
// - The default set in the ConfigDWORDInfo
static DWORD GetKnobDWORDValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul)
// - The default value passed in
static DWORD GetKnobDWORDValue(LPCWSTR name, DWORD defaultValue);
// Unfortunately our traditional config system insists on interpreting numbers as 32-bit so intepret the config
// in the traditional way separately if you need to.
//
// Returns value for name if found in config.
static ULONGLONG GetKnobULONGLONGValue(LPCWSTR name, ULONGLONG defaultValue);
// Returns (in priority order):
// - The value of the ConfigStringInfo if it's set
// - The value of the ConfigurationKnob (searched by name) if it's set
// - nullptr
static LPCWSTR GetKnobStringValue(LPCWSTR name, const CLRConfig::ConfigStringInfo& stringInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set
// - nullptr
static LPCWSTR GetKnobStringValue(LPCWSTR name);
// Returns (in priority order):
// - The value of the ConfigDWORDInfo if it's set (1 is true, anything else is false)
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with "true").
// - The default set in the ConfigDWORDInfo (1 is true, anything else is false)
static bool GetKnobBooleanValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with "true").
// - The default value passed in
static bool GetKnobBooleanValue(LPCWSTR name, bool defaultValue);
};
#endif // __configuration_h__