/usr/include/clang/Index/Handlers.h is in libclang-dev 3.0-6ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | //===--- Handlers.h - Interfaces for receiving information ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Abstract interfaces for receiving information.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_INDEX_HANDLERS_H
#define LLVM_CLANG_INDEX_HANDLERS_H
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/SmallVector.h"
namespace clang {
namespace idx {
class Entity;
class TranslationUnit;
class TULocation;
/// \brief Abstract interface for receiving Entities.
class EntityHandler {
public:
typedef Entity receiving_type;
virtual ~EntityHandler();
virtual void Handle(Entity Ent) = 0;
};
/// \brief Abstract interface for receiving TranslationUnits.
class TranslationUnitHandler {
public:
typedef TranslationUnit* receiving_type;
virtual ~TranslationUnitHandler();
virtual void Handle(TranslationUnit *TU) = 0;
};
/// \brief Abstract interface for receiving TULocations.
class TULocationHandler {
public:
typedef TULocation receiving_type;
virtual ~TULocationHandler();
virtual void Handle(TULocation TULoc) = 0;
};
/// \brief Helper for the Handler classes. Stores the objects into a vector.
/// example:
/// @code
/// Storing<TranslationUnitHandler> TURes;
/// IndexProvider.GetTranslationUnitsFor(Entity, TURes);
/// for (Storing<TranslationUnitHandler>::iterator
/// I = TURes.begin(), E = TURes.end(); I != E; ++I) { ....
/// @endcode
template <typename handler_type>
class Storing : public handler_type {
typedef typename handler_type::receiving_type receiving_type;
typedef SmallVector<receiving_type, 8> StoreTy;
StoreTy Store;
public:
virtual void Handle(receiving_type Obj) {
Store.push_back(Obj);
}
typedef typename StoreTy::const_iterator iterator;
iterator begin() const { return Store.begin(); }
iterator end() const { return Store.end(); }
};
} // namespace idx
} // namespace clang
#endif
|