13 #ifndef __NET_NETWORKCOOKIESTORE_H__
14 #define __NET_NETWORKCOOKIESTORE_H__
32 #define NO_DISCARD SYS_NO_DISCARD_RESULT
43 template <
typename T,
typename... Args>
46 return UTmakeShared<T>(std::forward<Args>(
args)...);
75 [weak = weak_from_this(), ptr, cookie]()
83 (observer.*
ptr)(cookie);
109 ForcePersistentCookies
117 : myDomain(cookie.domain())
118 , myName(cookie.
name())
119 , myPath(cookie.
path())
125 return myDomain == other.myDomain && myName == other.myName
126 && myPath == other.myPath;
130 return !(*
this == other);
136 SYShashCombine(h, myName.hash());
137 SYShashCombine(h, myPath.hash());
162 typename ExecutionContext,
165 hboost::asio::execution_context &>>>
167 ExecutionContext &ctx,
178 auto store = UTmakeShared<NET_NetworkCookieStore>(
180 store->configure(filename, policy);
184 typename ExecutionContext,
187 hboost::asio::execution_context &>>>
189 ExecutionContext &ctx)
191 return create(ctx.get_executor());
196 return UTmakeShared<NET_NetworkCookieStore>(
PrivateCtorTag{0}, exc);
220 CookieList cookiesForUrl(
const UT_Url &url)
const;
222 bool setCookiesFromUrl(
const CookieList &cookies,
const UT_Url &url);
224 void deleteAllCookies();
226 void setStoragePolicy(StoragePolicy
policy);
229 void debugPrintStore()
const;
236 CookieList allCookies()
const;
252 class PendingOperation
263 : myType(type), myCookie(cookie)
273 void addPendingOperation_(
280 PendingOperationList &pending_ops);
288 StoragePolicy myStoragePolicy = StoragePolicy::ForcePersistentCookies;
290 PendingOperationList myPendingOps;
296 #endif // __NET_NETWORKCOOKIESTORE_H__
static UT_SharedPtr< NET_NetworkCookieStore > create(const ASIO_AnyExecutor &exc, const UT_StringHolder &filename, StoragePolicy policy)
typename std::enable_if< B, T >::type enable_if_t
Define Imath::enable_if_t to be std for C++14, equivalent for C++11.
NET_NetworkCookieStore(const PrivateCtorTag &, const ASIO_AnyExecutor &exc)
GT_API const UT_StringHolder filename
hboost::math::policies::policy< hboost::math::policies::domain_error< hboost::math::policies::ignore_error >, hboost::math::policies::pole_error< hboost::math::policies::ignore_error >, hboost::math::policies::overflow_error< hboost::math::policies::ignore_error >, hboost::math::policies::underflow_error< hboost::math::policies::ignore_error >, hboost::math::policies::denorm_error< hboost::math::policies::ignore_error >, hboost::math::policies::rounding_error< hboost::math::policies::ignore_error >, hboost::math::policies::evaluation_error< hboost::math::policies::ignore_error >, hboost::math::policies::indeterminate_result_error< hboost::math::policies::ignore_error > > policy
friend std::size_t hash_value(const UniqueKey &key)
getFileOption("OpenEXR:storage") storage
static UT_SharedPtr< NET_NetworkCookieStore > create(ExecutionContext &ctx, const UT_StringHolder &filename, StoragePolicy policy)
bool operator==(const UniqueKey &other) const
GLsizei const GLchar *const * path
std::size_t SYS_HashType
Define the type for hash values.
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
std::optional< T > UT_Optional
static UT_SharedPtr< T > create(Args &&...args)
std::enable_shared_from_this< T > UTenable_shared_from_this
GLint GLint GLsizei GLint GLenum GLenum type
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
SYS_HashType hash() const
hboost::shared_mutex NET_RWLock
void notifyDelete(const NET_NetworkCookie &cookie)
GLuint const GLchar * name
std::error_code UT_ErrorCode
void notifyInsert(const NET_NetworkCookie &cookie)
GLfloat GLfloat GLfloat GLfloat h
bool operator!=(const UniqueKey &other) const
UniqueKey(const NET_NetworkCookie &cookie)
virtual void onInsert(const NET_NetworkCookie &cookie)=0
**If you just want to fire and args
NET_INetworkCookieStoreObserver(const ASIO_AnyExecutor &exc)
static UT_SharedPtr< NET_NetworkCookieStore > create(ExecutionContext &ctx)
virtual void onDelete(const NET_NetworkCookie &cookie)=0
static UT_SharedPtr< NET_NetworkCookieStore > create(const ASIO_AnyExecutor &exc)
hboost::asio::any_io_executor ASIO_AnyExecutor
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter