v8toolkit  0.0.1
Utility library for embedding V8 Javascript engine in a c++ program
class_handler.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #define PRINT_SKIPPED_EXPORT_REASONS false
6 //#define PRINT_SKIPPED_EXPORT_REASONS false
7 
8 #include "helper_functions.h"
9 
10 class ClassHandler : public ast_matchers::MatchFinder::MatchCallback {
11 private:
12  SourceManager & source_manager;
13 
14  WrappedClass * top_level_class; // the class currently being wrapped
15  std::set<std::string> names_used;
16 
17 public:
18 
19  CompilerInstance & ci;
20 
21  /**
22  * This runs per-match from MyASTConsumer, but always on the same ClassHandler (this) object
23  */
24  virtual void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
25 
26 
27  ClassHandler(CompilerInstance &CI) :
28  ci(CI),
29  source_manager(CI.getSourceManager())
30  {}
31 
32 
33  // all matcher callbacks have been run, now do anything to process the entirety of the data
34  virtual void onEndOfTranslationUnit () override;
35 
36 
37  std::string handle_data_member(WrappedClass & containing_class, FieldDecl * field, const std::string & indentation);
38 
39 
40  void handle_class(WrappedClass & wrapped_class, // class currently being handled (not necessarily top level)
41  bool top_level = true,
42  const std::string & indentation = "");
43 
44 
45 
46 };
::std::string string
Definition: gtest-port.h:1097
virtual void onEndOfTranslationUnit() override
ClassHandler(CompilerInstance &CI)
Definition: class_handler.h:27
CompilerInstance & ci
Definition: class_handler.h:19
virtual void run(const ast_matchers::MatchFinder::MatchResult &Result) override
std::string handle_data_member(WrappedClass &containing_class, FieldDecl *field, const std::string &indentation)
void handle_class(WrappedClass &wrapped_class, bool top_level=true, const std::string &indentation="")