Make WvStreams compile with gcc 4.4.
[wvstreams.git] / include / unipstoregen.h
blobdf9ca3017934a960a2386c12a670c115d50ad5ec
1 /* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2003 Net Integration Technologies, Inc.
5 * A generator that exposes Windows protected storage.
7 * When linking statically, use the following #pragma to ensure this
8 * generator gets registered:
9 * #pragma comment(linker, "/include:?UniPStoreGenMoniker@@3V?$WvMoniker@VUniConfGen@@@@A")
12 #ifndef __UNICONFPSTORE_H
13 #define __UNICONFPSTORE_H
15 #include "uniconfgen.h"
16 #include "wvlog.h"
17 #include "windows.h"
19 #include "pstorec.tlh"
21 #define PST_KEY_CURRENT_USER 0x00000000 // Specifies that the storage is maintained in the current user section of the registry.
22 #define PST_KEY_LOCAL_MACHINE 0x00000001 // Specifies that the storage is maintained in the local machine section of the registry.
24 #define PST_E_OK 0x00000000L // The operation was successful.
25 #define PST_E_TYPE_EXISTS 0x800C0004L // The data item already exists in the protected storage.
26 #define PST_E_UNKNOWN_TYPE 0x800C0005L
27 #define PST_E_NOT_FOUND 0x800C0010L
29 #define PST_PF_ALWAYS_SHOW 0x00000001 // Requests that the provider show the prompt dialog to the user even if not required for this access.
30 #define PST_PF_NEVER_SHOW 0x00000002 // Do not show the prompt dialog to the user.
32 #define PST_CF_DEFAULT 0x00000000 // Allows user to choose confirmation style.
33 #define PST_CF_NONE 0x00000001 // Forces silent item creation.
35 /**
36 * A generator that exposes Windows protected storage.
38 * To mount, use the moniker
39 * "pstore:PST_KEY_CURRENT_USER:TYPENAME:TYPEGUID:SUBTYPE:SUBTYPEGUID"
42 class UniPStoreGen : public UniConfGen
44 private:
45 WvLog m_log;
46 HMODULE m_hPstoreDLL;
47 PSTORECLib::IPStorePtr m_spPStore;
48 GUID m_type, m_subtype;
49 DWORD m_key;
51 HRESULT create_types(WvString type_name, WvString subtype_name);
53 protected:
54 virtual void flush_buffers() { }
56 public:
57 UniPStoreGen(WvString _base);
58 virtual ~UniPStoreGen();
60 /***** Overridden methods *****/
62 virtual bool isok();
63 virtual WvString get(const UniConfKey &key);
64 virtual void set(const UniConfKey &key, WvStringParm value);
65 virtual void setv(const UniConfPairList &pairs);
66 virtual bool exists(const UniConfKey &key);
67 virtual bool haschildren(const UniConfKey &key);
68 virtual Iter *iterator(const UniConfKey &key);
72 #endif // __UNICONFPSTORE_H