MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
password_cache.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; version 2 of the
7  * License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17  * 02110-1301 USA
18  */
19 
20 #ifndef _MFORMS_PASSWORD_CACHE_H_
21 #define _MFORMS_PASSWORD_CACHE_H_
22 
23 #include <string>
24 #include <cstddef>
25 
26 namespace mforms {
28  {
29  char *storage;
30  size_t storage_len;
31  size_t storage_size;
32 
33  PasswordCache();
35 
36  const char *find_password(const std::string &service, const std::string &account);
37  size_t find_block(const std::string &service, const std::string &account);
38  public:
39  static PasswordCache *get();
40 
42 
43  void add_password(const std::string &service, const std::string &account, const char *password);
44  void remove_password(const std::string &service, const std::string &account);
45 
46  bool get_password(const std::string &service, const std::string &account, std::string &ret_password);
47  };
48 };
49 
50 #endif
const char * find_password(const std::string &service, const std::string &account)
static PasswordCache instance
void add_password(const std::string &service, const std::string &account, const char *password)
size_t find_block(const std::string &service, const std::string &account)
bool get_password(const std::string &service, const std::string &account, std::string &ret_password)
void remove_password(const std::string &service, const std::string &account)
MySQL Workbench 6.1 documentation