forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugWriter.h
More file actions
46 lines (41 loc) · 1.29 KB
/
DebugWriter.h
File metadata and controls
46 lines (41 loc) · 1.29 KB
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#if ENABLE_REGEX_CONFIG_OPTIONS
#pragma once
namespace UnifiedRegex
{
class DebugWriter : private Chars<char16>
{
private:
static const Char* const hex;
static const int bufLen = 2048;
Char buf[bufLen];
int indent;
bool nlPending;
public:
DebugWriter();
void __cdecl Print(const Char *form, ...);
void __cdecl PrintEOL(const Char *form, ...);
void PrintEscapedString(const Char *str, CharCount len);
void PrintQuotedString(const Char *str, CharCount len);
void PrintEscapedChar(Char c);
void PrintQuotedChar(Char c);
void EOL();
void Indent();
void Unindent();
void Flush();
private:
inline void CheckForNewline()
{
if (nlPending)
{
BeginLine();
nlPending = false;
}
}
void BeginLine();
};
}
#endif