~ubuntu-branches/ubuntu/oneiric/codelite/oneiric

« back to all changes in this revision

Viewing changes to CodeLite/ctags_manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-04-09 02:03:19 UTC
  • mfrom: (0.1.3 sid) (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409020319-302693n3vroavxwe
Tags: 2.5.2.4031~dfsg-1
* New upstream release.
* Refresh patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        Normalize_Func_Name          = 0x00000001,
75
75
        // variable default value
76
76
        Normalize_Func_Default_value = 0x00000002,
 
77
        // re-place back macros
 
78
        Normalize_Func_Reverse_Macro = 0x00000004
 
79
};
 
80
 
 
81
enum FunctionFormatFlag {
 
82
        FunctionFormat_WithVirtual   = 0x00000001,
 
83
        FunctionFormat_Impl          = 0x00000002
77
84
};
78
85
 
79
86
class ITagsStorage;
114
121
        friend class Singleton<TagsManager>;
115
122
        friend class DirTraverser;
116
123
        friend class Language;
117
 
 
 
124
        
 
125
public:
 
126
        wxCriticalSection      m_crawlerLocker;
 
127
        
 
128
private:
118
129
        ITagsStorage *                m_workspaceDatabase;
119
130
        wxCriticalSection             m_cs;
120
 
        wxCriticalSection             m_crawlerLocker;
121
131
        wxFileName                    m_codeliteIndexerPath;
122
132
        clProcess*                    m_codeliteIndexerProcess;
123
133
        wxString                      m_ctagsCmd;
134
144
        bool                          m_enableCaching;
135
145
        wxEvtHandler*                 m_evtHandler;
136
146
        std::set<wxString>            m_CppIgnoreKeyWords;
 
147
        wxArrayString                 m_projectPaths;
137
148
public:
138
149
 
139
150
        void SetLanguage(Language *lang);
273
284
         * @return true if the file name extension matches the current running ctags file spec
274
285
         */
275
286
        bool IsValidCtagsFile(const wxFileName &filename) const;
276
 
 
 
287
        
 
288
        /**
 
289
         * @brief set the project paths
 
290
         */
 
291
        void SetProjectPaths(const wxArrayString &paths);
 
292
        
 
293
        /**
 
294
         * @return project file paths
 
295
         */
 
296
        const wxArrayString& GetProjectPaths() const {return m_projectPaths;} 
 
297
        
277
298
        /**
278
299
         * Find symbols by name and scope.
279
300
         * @param name symbol name
544
565
         * @param partName name criterion (partial)
545
566
         */
546
567
        void GetTagsByKind(std::vector<TagEntryPtr> &tags, const wxArrayString &kind, const wxString &partName = wxEmptyString);
 
568
        
 
569
        /**
 
570
         * @brief return list of tags by KIND
 
571
         * @param tags [output]
 
572
         * @param kind the kind of the tags to fetch from the database
 
573
         * @param partName name criterion (partial)
 
574
         */
 
575
        void GetTagsByKindLimit(std::vector<TagEntryPtr> &tags, const wxArrayString &kind, int limit, const wxString &partName = wxEmptyString);
547
576
 
548
577
        /**
549
578
         * @brief generate function body/impl based on a tag
552
581
         * @param scope real function scope to use
553
582
         * @return the function impl/decl
554
583
         */
555
 
        wxString FormatFunction(TagEntryPtr tag, bool impl = false, const wxString &scope = wxEmptyString);
 
584
        wxString FormatFunction(TagEntryPtr tag, size_t flags = FunctionFormat_WithVirtual, const wxString &scope = wxEmptyString);
556
585
 
557
586
        /**
558
587
         * @brief return true of the tag contains a pure virtual function
572
601
         * @param scope
573
602
         * @return
574
603
         */
575
 
        bool IsTypeAndScopeExists(const wxString &typeName, wxString &scope);
 
604
        bool IsTypeAndScopeExists(wxString &typeName, wxString &scope);
576
605
 
577
606
        /**
578
 
         * @brief return true if type & scope do exist in the symbols database and is container
579
 
         * @param typeName
580
 
         * @param scope
 
607
         * @brief return true if type & scope do exist in the symbols database and is container. This function also modifies the
 
608
         * typeName & scope to match real typename and scope (according to the TagsStorage)
 
609
         * @param typeName [intput/output]
 
610
         * @param scope    [intput/output]
581
611
         * @return
582
612
         */
583
 
        bool IsTypeAndScopeContainer(const wxString &typeName, wxString &scope);
 
613
        bool IsTypeAndScopeContainer(wxString &typeName, wxString &scope);
584
614
 
585
615
        /**
586
616
         * @brief try to process a given expression and evaluate it into type & typescope
647
677
         * @param pattern ctags pattern of the method
648
678
         * @return return value of the method from the pattern of empty string
649
679
         */
650
 
        wxString GetFunctionReturnValueFromPattern(const wxString &pattern);
 
680
        wxString GetFunctionReturnValueFromPattern(TagEntryPtr tag);
651
681
        /**
652
682
         * @brief fileter a recently tagged files from the strFiles array
653
683
         * @param strFiles
662
692
         * @return tag tree, must be freed by caller
663
693
         */
664
694
        TagTreePtr TreeFromTags(const wxString& tags, int &count);
665
 
 
 
695
        
666
696
        /**
667
 
         * @brief lock/unlock the TagsManager locker
 
697
         * @brief clear the underlying caching mechanism
668
698
         */
669
 
        void CrawlerLock();
670
 
        void CrawlerUnlock();
 
699
        void ClearTagsCache();
671
700
 
672
701
protected:
673
702
        std::map<wxString, bool> m_typeScopeCache;