Example #1
0
/**
 * \brief Given a cursor that references something else, return the source range
 * covering that reference.
 *
 * \param C A cursor pointing to a member reference, a declaration reference, or
 * an operator call.
 * \param NameFlags A bitset with three independent flags:
 * CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and
 * CXNameRange_WantSinglePiece.
 * \param PieceIndex For contiguous names or when passing the flag
 * CXNameRange_WantSinglePiece, only one piece with index 0 is
 * available. When the CXNameRange_WantSinglePiece flag is not passed for a
 * non-contiguous names, this index can be used to retreive the individual
 * pieces of the name. See also CXNameRange_WantSinglePiece.
 *
 * \returns The piece of the name pointed to by the given cursor. If there is no
 * name, or if the PieceIndex is out-of-range, a null-cursor will be returned.
 */
func (c Cursor) ReferenceNameRange(flags NameRefFlags, pieceIdx uint) SourceRange {
	o := C.clang_getCursorReferenceNameRange(c.c,
		C.uint(flags), C.uint(pieceIdx))
	return SourceRange{o}
}
Example #2
0
/*
	Given a cursor that references something else, return the source range
	covering that reference.

	Parameter C A cursor pointing to a member reference, a declaration reference, or
	an operator call.
	Parameter NameFlags A bitset with three independent flags:
	CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and
	CXNameRange_WantSinglePiece.
	Parameter PieceIndex For contiguous names or when passing the flag
	CXNameRange_WantSinglePiece, only one piece with index 0 is
	available. When the CXNameRange_WantSinglePiece flag is not passed for a
	non-contiguous names, this index can be used to retrieve the individual
	pieces of the name. See also CXNameRange_WantSinglePiece.

	Returns The piece of the name pointed to by the given cursor. If there is no
	name, or if the PieceIndex is out-of-range, a null-cursor will be returned.
*/
func (c Cursor) ReferenceNameRange(nameFlags uint32, pieceIndex uint32) SourceRange {
	return SourceRange{C.clang_getCursorReferenceNameRange(c.c, C.uint(nameFlags), C.uint(pieceIndex))}
}