Returns true on success
| 59 | |
| 60 | //Returns true on success |
| 61 | class ChangeResult |
| 62 | { |
| 63 | public: |
| 64 | explicit ChangeResult(const QString& failureReason, |
| 65 | const DocumentChangePointer& reasonChange = DocumentChangePointer()) |
| 66 | : ChangeResult(failureReason, reasonChange, false) {} |
| 67 | |
| 68 | static ChangeResult successfulResult() |
| 69 | { |
| 70 | return ChangeResult({}, {}, true); |
| 71 | } |
| 72 | |
| 73 | operator bool() const |
| 74 | { |
| 75 | return m_success; |
| 76 | } |
| 77 | |
| 78 | /// Reason why the change failed |
| 79 | QString m_failureReason; |
| 80 | /// Specific change that caused the problem (might be 0) |
| 81 | DocumentChangePointer m_reasonChange; |
| 82 | |
| 83 | bool m_success; |
| 84 | |
| 85 | private: |
| 86 | explicit ChangeResult(const QString& failureReason, const DocumentChangePointer& reasonChange, bool success) |
| 87 | : m_failureReason(failureReason) |
| 88 | , m_reasonChange(reasonChange) |
| 89 | , m_success(success) |
| 90 | {} |
| 91 | }; |
| 92 | |
| 93 | /// Add an individual local change to this change-set. |
| 94 | ChangeResult addChange(const DocumentChange& change); |
no outgoing calls
no test coverage detected