From ef4e61cd241a7e8cd41ac49621a81952267c3dfb Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 20 Jul 2020 11:58:28 +0100 Subject: Pascalize ExtensionItem::{get,set,unset}_raw. --- include/extensible.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/extensible.h b/include/extensible.h index 4955fd924..233e90b6b 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -23,7 +23,9 @@ #pragma once /** Base class for logic that extends an Extensible object. */ -class CoreExport ExtensionItem : public ServiceProvider, public usecountbase +class CoreExport ExtensionItem + : public ServiceProvider + , public usecountbase { public: /** Types of Extensible that an ExtensionItem can apply to. */ @@ -99,20 +101,20 @@ class CoreExport ExtensionItem : public ServiceProvider, public usecountbase * @param container The container that the ExtensionItem is set on. * @return Either the value of this ExtensionItem or NULL if it is not set. */ - void* get_raw(const Extensible* container) const; + void* GetRaw(const Extensible* container) const; /** Stores a value for this ExtensionItem in the internal map and returns the old value if one was set. * @param container A container the ExtensionItem should be set on. * @param value The value to set on the specified container. * @return Either the old value or NULL if one is not set. */ - void* set_raw(Extensible* container, void* value); + void* SetRaw(Extensible* container, void* value); /** Removes the value for this ExtensionItem from the internal map and returns it. * @param container A container the ExtensionItem should be removed from. * @return Either the old value or NULL if one is not set. */ - void* unset_raw(Extensible* container); + void* UnsetRaw(Extensible* container); }; /** class Extensible is the parent class of many classes such as User and Channel. @@ -202,25 +204,25 @@ class SimpleExtItem : public ExtensionItem inline T* get(const Extensible* container) const { - return static_cast(get_raw(container)); + return static_cast(GetRaw(container)); } inline void set(Extensible* container, const T& value) { T* ptr = new T(value); - T* old = static_cast(set_raw(container, ptr)); + T* old = static_cast(SetRaw(container, ptr)); Delete(container, old); } inline void set(Extensible* container, T* value) { - T* old = static_cast(set_raw(container, value)); + T* old = static_cast(SetRaw(container, value)); Delete(container, old); } inline void unset(Extensible* container) { - T* old = static_cast(unset_raw(container)); + T* old = static_cast(UnsetRaw(container)); Delete(container, old); } @@ -297,7 +299,7 @@ class CoreExport IntExtItem : public ExtensionItem /** @copydoc ExtensionItem::FromNetwork */ void FromNetwork(Extensible* container, const std::string& value) override; - /** Sets a value for this IntExtItem. + /** Sets a value for this IntExtItem. * @param container A container that the IntExtItem should be set on. */ void set(Extensible* container, intptr_t value); -- cgit v1.3.1-10-gc9f91