13 #ifndef __NET_NETWORKCOOKIESTORE_H__
14 #define __NET_NETWORKCOOKIESTORE_H__
31 #define NO_DISCARD SYS_NO_DISCARD_RESULT
42 template <
typename T,
typename... Args>
45 return UTmakeShared<T>(std::forward<Args>(
args)...);
74 [weak = weak_from_this(), ptr, cookie]()
82 (observer.*
ptr)(cookie);
108 ForcePersistentCookies
116 : myDomain(cookie.domain())
117 , myName(cookie.
name())
118 , myPath(cookie.
path())
124 return myDomain == other.myDomain && myName == other.myName
125 && myPath == other.myPath;
129 return !(*
this == other);
135 SYShashCombine(h, myName.hash());
136 SYShashCombine(h, myPath.hash());
161 typename ExecutionContext,
164 hboost::asio::execution_context &>>>
166 ExecutionContext &ctx,
177 auto store = UTmakeShared<NET_NetworkCookieStore>(
179 store->configure(filename, policy);
183 typename ExecutionContext,
186 hboost::asio::execution_context &>>>
188 ExecutionContext &ctx)
190 return create(ctx.get_executor());
195 return UTmakeShared<NET_NetworkCookieStore>(
PrivateCtorTag{0}, exc);
219 CookieList cookiesForUrl(
const UT_Url &url)
const;
221 bool setCookiesFromUrl(
const CookieList &cookies,
const UT_Url &url);
223 void deleteAllCookies();
225 void setStoragePolicy(StoragePolicy
policy);
228 void debugPrintStore()
const;
235 CookieList allCookies()
const;
251 class PendingOperation
262 : myType(type), myCookie(cookie)
272 void addPendingOperation_(
279 PendingOperationList &pending_ops);
287 StoragePolicy myStoragePolicy = StoragePolicy::ForcePersistentCookies;
289 PendingOperationList myPendingOps;
295 #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.
std::optional< T > UT_Optional
static UT_SharedPtr< T > create(Args &&...args)
std::enable_shared_from_this< T > UTenable_shared_from_this
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)
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
hboost::asio::any_io_executor ASIO_AnyExecutor
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter