File: RemoteObject.h

package info (click to toggle)
codelite 14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 112,816 kB
  • sloc: cpp: 483,662; ansic: 150,144; php: 9,569; lex: 4,186; python: 3,417; yacc: 2,820; sh: 1,147; makefile: 52; xml: 13
file content (54 lines) | stat: -rw-r--r-- 2,115 bytes parent folder | download | duplicates (4)
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
#ifndef NODEDBGREMOTEOBJECT_H
#define NODEDBGREMOTEOBJECT_H

#include "ObjectPreview.h"
#include "nSerializableObject.h"
#include <wx/string.h>

class RemoteObject : public nSerializableObject
{
    wxString m_type;
    wxString m_subtype;
    wxString m_className;
    wxString m_value;
    ObjectPreview m_preview;
    wxString m_expression; // The expression originated this object
    wxString m_objectId;

public:
    RemoteObject();
    virtual ~RemoteObject();

    void FromJSON(const JSONItem& json);
    JSONItem ToJSON(const wxString& name) const;
    bool IsObject() const { return GetType() == "object"; }
    bool IsString() const { return GetType() == "string"; }
    bool IsUndefined() const { return GetType() == "undefined"; }
    bool IsFunction() const { return GetType() == "function"; }

    void SetObjectId(const wxString& objectId) { this->m_objectId = objectId; }
    const wxString& GetObjectId() const { return m_objectId; }
    void SetClassName(const wxString& className) { this->m_className = className; }
    void SetSubtype(const wxString& subtype) { this->m_subtype = subtype; }
    void SetType(const wxString& type) { this->m_type = type; }
    void SetValue(const wxString& value) { this->m_value = value; }
    const wxString& GetClassName() const { return m_className; }
    const wxString& GetSubtype() const { return m_subtype; }
    const wxString& GetType() const { return m_type; }
    const wxString& GetValue() const { return m_value; }
    void SetExpression(const wxString& expression) { this->m_expression = expression; }
    const wxString& GetExpression() const { return m_expression; }
    void SetPreview(const ObjectPreview& preview) { this->m_preview = preview; }
    const ObjectPreview& GetPreview() const { return m_preview; }
    /**
     * @brief return a string representing this obejct for UI display (tooltip, console etc)
     */
    wxString ToString() const;
    bool IsEmpty() const { return m_type.IsEmpty(); }
    
    // For display purposes
    wxString GetTextPreview() const;
    bool HasChildren() const;
};

#endif // NODEDBGREMOTEOBJECT_H