clang-tags
C/C++ source code indexing tool based on libclang
 All Classes Functions Variables Typedefs Groups Pages
Classes | Public Member Functions | Friends | List of all members
LibClang::SourceLocation Class Reference

Location in the source code. More...

#include <sourceLocation.hxx>

Classes

struct  Position
 Physical position in the source code. More...

Public Member Functions

bool operator== (const SourceLocation &other) const
 Equality operator.
const Position expansionLocation () const
 Get the associated physical position.

Friends

class TranslationUnit
class Cursor

Detailed Description

Location in the source code.

This class is a proxy for libclang's CXSourceLocation type. It should provide the same features.

A physical source location is mainly identified by the parameters in a Position structure, a retrieved by the expansionLocation() method.

Note that a source location can be associated to different physical locations, especially in the case of macro expansions, which can either refer to the actual expansion, or the macro definition.

Member Function Documentation

const SourceLocation::Position LibClang::SourceLocation::expansionLocation ( ) const

Get the associated physical position.

If the location refers to a macro expansion, return the position of the expansion itself, instead of the macro definition.

Returns
a Position structure
bool LibClang::SourceLocation::operator== ( const SourceLocation other) const

Equality operator.

Parameters
otherSourceLocation to be compared with
Returns
true if the two source locations are identical

The documentation for this class was generated from the following files: