blob: 2d70e4370a905e24bf87e0b99d17539d167e1c3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/*
* Library Initialization
* (C) 1999-2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_LIBRARY_INITIALIZER_H__
#define BOTAN_LIBRARY_INITIALIZER_H__
#include <botan/build.h>
#include <string>
namespace Botan {
/**
* This class represents the Library Initialization/Shutdown Object. It
* has to exceed the lifetime of any Botan object used in an
* application. You can call initialize/deinitialize or use
* LibraryInitializer in the RAII style.
*/
class BOTAN_DLL LibraryInitializer
{
public:
/**
* Initialize the library
* @param options a string listing initialization options
*/
static void initialize(const std::string& options = "");
/**
* Shutdown the library
*/
static void deinitialize();
/**
* Initialize the library
* @param options a string listing initialization options
*/
LibraryInitializer(const std::string& options = "")
{ LibraryInitializer::initialize(options); }
~LibraryInitializer() { LibraryInitializer::deinitialize(); }
};
}
#endif
|