saveTranslationUnit | R Documentation |
saveTranslationUnit
writes a parsed translation unit into a serialized representation of
that translation unit to a file that can then be reread back into
memory.
In many cases, we can just recreat the translation unit from the source
code. However, this provides a way to work without the source code,
parser options and command line arguments.
The translation unit needs to have been created without any errors.
We query the set of flags for saving a translation unit via
defaultSaveOptions
.
This is a value we can pass via the options
parameter of saveTranslationUnit
.
saveTranslationUnit(TU, FileName, options = 0)
defaultSaveOptions(TU)
TU |
a translation unit object. This is rarely specified by the
caller but created implicitly via |
FileName |
the fully-qualified name of the source code file |
options |
options for saving the translation unit. This is a collection of values fromthe CXSaveTranslationUnit_Flags object, but this is should always be 0 at present |
saveTranslationUnit
returns a CXSaveError
error
indicating success or the nature of the error.
defaultSaveOptions
returns an integer value.
Duncan Temple Lang
libclang http://clang.llvm.org/doxygen/group__CINDEX.html
createTU
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.