13 int indentation)
const {
15 stream << std::string(indentation,
' ') <<
"// " <<
description_ <<
"\n";
17 stream << std::string(indentation,
' ') <<
"// " <<
pos_ <<
"\n";
18 stream << std::string(indentation,
' ');
19 if (IsExport()) stream <<
"V8_EXPORT_PRIVATE ";
21 stream <<
"V8_INLINE ";
25 if (IsConstexpr()) stream <<
"constexpr ";
29 if (!first) stream <<
", ";
31 if (!p.name.empty()) stream <<
" " << p.name;
32 if (!p.default_value.empty()) stream <<
" = " << p.default_value;
36 if (IsConst()) stream <<
" const";
48 std::ostream& stream,
const std::function<
void(std::ostream&)>& builder,
49 int indentation)
const {
58 std::ostream& stream,
const std::function<
void(std::ostream&)>& builder,
59 int indentation)
const {
69 int indentation)
const {
70 stream << std::string(indentation,
' ') <<
"// " <<
pos_ <<
"\n";
74 const auto class_template_parameters =
76 if (!class_template_parameters.empty()) {
77 stream << std::string(indentation,
' ');
78 stream <<
"template<";
81 for (
const auto& p : class_template_parameters) {
87 stream <<
"class " << p.name;
89 stream << p.type <<
" " << p.name;
99 stream << std::string(indentation,
' ') <<
return_type_ <<
" " << scope
103 if (!first) stream <<
", ";
105 if (!p.name.empty()) stream <<
" " << p.name;
116 stream << std::string(indentation,
' ');
121 s() <<
"#ifndef " << name
128 s() <<
"#endif // " << name <<
"\n";
133 DCHECK_EQ(name.find(
':'), std::string::npos);
134 s() <<
"namespace " << name <<
" {\n";
std::string GetName() const
std::vector< TemplateParameter > GetTemplateParameters() const
void EndIncludeGuard(const std::string &name)
std::stack< std::string > namespaces_
void BeginIncludeGuard(const std::string &name)
void EndNamespace(const std::string &name)
void BeginNamespace(std::string name)
void PrintDeclaration(std::ostream &stream, int indentation=kAutomaticIndentation) const
void PrintEndDefinition(std::ostream &stream, int indentation=0) const
static constexpr int kAutomaticIndentation
void PrintInlineDefinition(std::ostream &stream, const std::function< void(std::ostream &)> &builder, int indentation=2) const
void PrintBeginDefinition(std::ostream &stream, int indentation=0) const
void PrintDeclarationHeader(std::ostream &stream, int indentation) const
std::vector< Parameter > parameters_
void PrintDefinition(std::ostream &stream, const std::function< void(std::ostream &)> &builder, int indentation=0) const
bool IsStatic(FunctionKind kind)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)