prettifyCLANG: Prettify C, C++, Java

View source: R/prettifyCLANG.R

prettifyCLANGR Documentation

Prettify C, C++, Java

Description

Prettify some C, C++ or Java code.

Usage

prettifyCLANG(contents = NA, language = NA, tabSize = NULL)

Arguments

contents

the code to be prettified; there are three possibilities for this argument: NA (default), to use the file currently opened in RStudio; the path to a file; or the code given as a character vector

language

the language of the code; when the contents is read from a file, this option is ignored, because the language is obtained from the extension of the file

tabSize

number of spaces of the indentation (usually 2 or 4); if NULL (the default), there are two possibilities: if the contents is read from the current file in RStudio, then the number of spaces will be the one you use in RStudio; otherwise it is set to 2

Value

The pretty code in a character string.

Note

This function requires the command line utility clang-format.


prettifyAddins documentation built on Sept. 14, 2023, 5:06 p.m.