regkey.h

Go to the documentation of this file.
00001 00004 /* 00005 * Copyright © 2000, 2001 Paul Hollingsworth 00006 * 00007 * This material is provided "as is", with absolutely no warranty 00008 * expressed or implied. Any use is at your own risk. Permission to 00009 * use or copy this software for any purpose is hereby granted without 00010 * fee, provided the above notices are retained on all copies. 00011 * Permission to modify the code and to distribute modified code is 00012 * granted, provided the above notices are retained, and a notice that 00013 * the code was modified is included with the above copyright notice. 00014 * 00015 * This header is part of comet. 00016 * http://www.lambdasoft.dk/comet 00017 */ 00018 00019 #ifndef COMET_REGKEY_H 00020 #define COMET_REGKEY_H 00021 00022 #include <comet/config.h> 00023 00024 #include <comet/registry.h> 00025 #include <comet/error.h> 00026 00027 namespace comet 00028 { 00032 struct reg_error 00033 { 00034 static void on_error(LONG errcode) 00035 { 00036 throw com_error(HRESULT_FROM_WIN32(errcode)); 00037 } 00038 00039 static void on_typemismatch() 00040 { 00041 throw com_error(HRESULT_FROM_WIN32(ERROR_INVALID_DATATYPE)); 00042 } 00043 }; 00044 00047 typedef registry::key<reg_error> regkey; 00048 00049 } 00050 00051 namespace std { 00052 00053 COMET_DECLARE_SWAP(comet::regkey) 00054 COMET_DECLARE_SWAP(comet::regkey::info_type) 00055 COMET_DECLARE_SWAP(comet::regkey::mapped_type) 00056 COMET_DECLARE_SWAP(comet::regkey::values_type) 00057 COMET_DECLARE_SWAP(comet::regkey::subkeys_type) 00058 COMET_DECLARE_SWAP(comet::regkey::value_names_type) 00059 COMET_DECLARE_SWAP(comet::regkey::values_type::iterator) 00060 COMET_DECLARE_SWAP(comet::regkey::values_type::const_iterator) 00061 COMET_DECLARE_SWAP(comet::regkey::subkeys_type::iterator) 00062 COMET_DECLARE_SWAP(comet::regkey::value_names_type::iterator) 00063 } 00064 00065 #endif