Class: CppComment

CppComment()

new CppComment()

C/C++ comment
Properties:
Name Type Description
loc CppCommentLocation location
comments Array.<(string|Array.<string>)> one string without carriage-return/line-feed per comment line
id Number ID of commented entity
Source:

Members

Types

Types of comment
Source:

Methods

(static) from(obj) → {CppComment}

Create a new CppComment instance from a object with the comment set of property
Parameters:
Name Type Description
obj Object an object
Source:
Returns:
an instance of CppComment
Type
CppComment

(static) make(text, begin_marker, marker, type) → {CppComment}

Create a new CppComment
Parameters:
Name Type Description
text string text of comment
begin_marker Marker begin marker
marker Marker end marker (after line-feed for C++ comments)
type string type of comment (one of CppComment::Types)
Source:
Returns:
an instance of CppComment
Type
CppComment

(static) trim(text_block, type) → {Array.<string>}

Trim comment text block
Parameters:
Name Type Description
text_block Array.<string> a text block
type string type of comment (one of CppComment::Types)
Source:
Returns:
a trimmed comment text block
Type
Array.<string>

bind(document)

Bind a comment to a Clang AST element
Parameters:
Name Type Description
document Object A Clang AST element
Source:

export() → {Object|undefined}

Export comment for persistency in the database
Source:
Returns:
an object ready for storing in the database or undefined if comment result in something empty after trimming
Type
Object | undefined

is_bound() → {boolean}

Test whether comment is bound to a Clang AST element
Source:
Returns:
result of the rest
Type
boolean

merge(text, marker)

Merge comment
Parameters:
Name Type Description
text string text to append
marker Marker new end marker (after line-feed for C++ comments)
Source:

CppComment(loc, comments, id, type)

new CppComment(loc, comments, id, type)

constructor
Parameters:
Name Type Description
loc CppCommentLocation comment location
comments Array.<string> comment text, one string without carriage-return/line-feed per comment line
id Number ID of commented entity
type string type of comment (one of CppComment::Types)
Source:

Members

Types

Types of comment
Source:

Methods

(static) from(obj) → {CppComment}

Create a new CppComment instance from a object with the comment set of property
Parameters:
Name Type Description
obj Object an object
Source:
Returns:
an instance of CppComment
Type
CppComment

(static) make(text, begin_marker, marker, type) → {CppComment}

Create a new CppComment
Parameters:
Name Type Description
text string text of comment
begin_marker Marker begin marker
marker Marker end marker (after line-feed for C++ comments)
type string type of comment (one of CppComment::Types)
Source:
Returns:
an instance of CppComment
Type
CppComment

(static) trim(text_block, type) → {Array.<string>}

Trim comment text block
Parameters:
Name Type Description
text_block Array.<string> a text block
type string type of comment (one of CppComment::Types)
Source:
Returns:
a trimmed comment text block
Type
Array.<string>

bind(document)

Bind a comment to a Clang AST element
Parameters:
Name Type Description
document Object A Clang AST element
Source:

export() → {Object|undefined}

Export comment for persistency in the database
Source:
Returns:
an object ready for storing in the database or undefined if comment result in something empty after trimming
Type
Object | undefined

is_bound() → {boolean}

Test whether comment is bound to a Clang AST element
Source:
Returns:
result of the rest
Type
boolean

merge(text, marker)

Merge comment
Parameters:
Name Type Description
text string text to append
marker Marker new end marker (after line-feed for C++ comments)
Source: