// Copyright (c) 2010 Martin Knafve / hMailServer.com. // http://www.hmailserver.com #pragma once #include "../TCPIP/IPAddress.h" namespace HM { class SecurityRange; enum PersistenceMode; class PersistentSecurityRange { public: PersistentSecurityRange(); virtual ~PersistentSecurityRange(); static bool DeleteObject(std::shared_ptr pSR); static bool SaveObject(std::shared_ptr pSR); static bool SaveObject(std::shared_ptr pSR, String &result, PersistenceMode mode); static bool ReadObject(std::shared_ptr pSR, std::shared_ptr pRS); static bool ReadObject(std::shared_ptr pSR, const SQLCommand &command); static bool ReadObject(std::shared_ptr pSR, __int64 ObjectID); static bool ReadObject(std::shared_ptr pSR, const String &name); static std::shared_ptr ReadMatchingIP(const IPAddress &ipaddress); static bool DeleteExpired(); static bool Exists(const String &name); private: static bool Validate(std::shared_ptr pSR, String &result); }; }