summaryrefslogtreecommitdiff
path: root/src/diagnosticfilename-inl.h
blob: a0d44fd56bcd600b543bd1c06745ea21bc8c2f95 (plain)
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
#ifndef SRC_DIAGNOSTICFILENAME_INL_H_
#define SRC_DIAGNOSTICFILENAME_INL_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node_internals.h"
namespace node {

class Environment;

inline DiagnosticFilename::DiagnosticFilename(
    Environment* env,
    const char* prefix,
    const char* ext) :
  filename_(MakeFilename(env->thread_id(), prefix, ext)) {
}

inline DiagnosticFilename::DiagnosticFilename(
    uint64_t thread_id,
    const char* prefix,
    const char* ext) :
  filename_(MakeFilename(thread_id, prefix, ext)) {
}

inline const char* DiagnosticFilename::operator*() const {
  return filename_.c_str();
}

}  // namespace node

#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif  // SRC_DIAGNOSTICFILENAME_INL_H_