1 : // Copyright 2012 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : //
15 : // Declares utility functions used by the parsers and various unittests.
16 :
17 : #ifndef SYZYGY_TRACE_PARSE_PARSE_UTILS_H_
18 : #define SYZYGY_TRACE_PARSE_PARSE_UTILS_H_
19 :
20 : #include "syzygy/trace/protocol/call_trace_defs.h"
21 :
22 m : namespace trace {
23 m : namespace parser {
24 :
25 : // Parses a windows environment string.
26 : // @param env_string a doubly-zero terminated compound environment string.
27 : // @param env_strings the object to receive the parsed environment strings.
28 m : bool ParseEnvironmentStrings(const wchar_t* env_string,
29 m : TraceEnvironmentStrings* env_strings);
30 :
31 : // Parses the blob of variable sized data fields at the end of @p header.
32 : // @param header the header to parse.
33 : // @param module_path the string to receive the module path.
34 : // @param command_line the string to receive the command line.
35 : // @param env_strings the object to receive the environment strings.
36 : // @returns true on success, false otherwise.
37 m : bool ParseTraceFileHeaderBlob(const TraceFileHeader& header,
38 m : std::wstring* module_path,
39 m : std::wstring* command_line,
40 m : TraceEnvironmentStrings* env_strings);
41 :
42 m : } // namespace parser
43 m : } // namespace trace
44 :
45 : #endif // SYZYGY_TRACE_PARSE_PARSE_UTILS_H_
|