| 1 |
////////////////////////////////////////////////////////////////////////////// |
| 2 |
////////////////////////////////////////////////////////////////////////////// |
| 3 |
// |
| 4 |
// Copyright : (C) 2015 Eran Ifrah |
| 5 |
// File name : PHPDocComment.h |
| 6 |
// |
| 7 |
// ------------------------------------------------------------------------- |
| 8 |
// A |
| 9 |
// _____ _ _ _ _ |
| 10 |
// / __ \ | | | | (_) | |
| 11 |
// | / \/ ___ __| | ___| | _| |_ ___ |
| 12 |
// | | / _ \ / _ |/ _ \ | | | __/ _ ) |
| 13 |
// | \__/\ (_) | (_| | __/ |___| | || __/ |
| 14 |
// \____/\___/ \__,_|\___\_____/_|\__\___| |
| 15 |
// |
| 16 |
// F i l e |
| 17 |
// |
| 18 |
// This program is free software; you can redistribute it and/or modify |
| 19 |
// it under the terms of the GNU General Public License as published by |
| 20 |
// the Free Software Foundation; either version 2 of the License, or |
| 21 |
// (at your option) any later version. |
| 22 |
// |
| 23 |
////////////////////////////////////////////////////////////////////////////// |
| 24 |
////////////////////////////////////////////////////////////////////////////// |
| 25 |
|
| 26 |
#ifndef PHPDOCCOMMENT_H |
| 27 |
#define PHPDOCCOMMENT_H |
| 28 |
|
| 29 |
#include "codelite_exports.h" |
| 30 |
#include <wx/string.h> |
| 31 |
#include <wx/arrstr.h> |
| 32 |
#include "PHPSourceFile.h" |
| 33 |
#include "macros.h" |
| 34 |
#include "wxStringHash.h" |
| 35 |
#include "PHPDocParam.h" |
| 36 |
|
| 37 |
class WXDLLIMPEXP_CL PHPDocComment |
| 38 |
{ |
| 39 |
public: |
| 40 |
struct Property |
| 41 |
{ |
| 42 |
wxString name; |
| 43 |
wxString type; |
| 44 |
wxString desc; |
| 45 |
typedef std::unordered_map<wxString, PHPDocComment::Property> Map_t; |
| 46 |
}; |
| 47 |
|
| 48 |
protected: |
| 49 |
PHPSourceFile& m_sourceFile; |
| 50 |
wxString m_comment; |
| 51 |
std::unordered_map<wxString, wxString> m_params; |
| 52 |
wxArrayString m_paramsArr; |
| 53 |
wxString m_returnValue; |
| 54 |
bool m_returnNullable; |
| 55 |
wxString m_varType; |
| 56 |
wxString m_varName; |
| 57 |
PHPDocComment::Property::Map_t m_properties; // @property, @property-read, @property-write |
| 58 |
PHPEntityBase::List_t m_methods; |
| 59 |
|
| 60 |
/** |
| 61 |
* @brief process @method php doc |
| 62 |
*/ |
| 63 |
void ProcessMethods(); |
| 64 |
|
| 65 |
public: |
| 66 |
PHPDocComment(PHPSourceFile& sourceFile, const wxString& comment); |
| 67 |
virtual ~PHPDocComment(); |
| 68 |
|
| 69 |
void SetComment(const wxString& comment) { this->m_comment = comment; } |
| 70 |
|
| 71 |
const wxString& GetVar() const; |
| 72 |
const wxString& GetReturn() const; |
| 73 |
const bool IsReturnNullable() const; |
| 74 |
const wxString& GetParam(const wxString& name) const; |
| 75 |
const wxString& GetParam(size_t index) const; |
| 76 |
const PHPDocComment::Property::Map_t& GetProperties() const { return m_properties; } |
| 77 |
PHPDocComment::Property::Map_t& GetProperties() { return m_properties; } |
| 78 |
const PHPEntityBase::List_t& GetMethods() const { return m_methods; } |
| 79 |
}; |
| 80 |
|
| 81 |
#endif // PHPDOCCOMMENT_H |