00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SECSTRING_H
00024 #define _SECSTRING_H
00025
00026 #ifdef HAVE_CONFIG_H
00027 # include <config.h>
00028 #endif
00029
00030 #ifdef HAVE_STRING_H
00031 # include <string.h>
00032 #endif
00033
00034 #ifdef HAVE_MEMORY
00035 # include <memory>
00036 #endif
00037
00038 #ifdef HAVE_STRING
00039 # include <string>
00040 #endif
00041
00050 namespace YAPETUI {
00051
00058 template <class T>
00059 class secallocator: public std::allocator<T> {
00060 public:
00061 void deallocate(typename std::allocator<T>::pointer p,
00062 typename std::allocator<T>::size_type n) {
00063 memset(p, '0', n*sizeof(std::allocator<T>::value_type));
00064 std::allocator<T>::deallocate(p, n);
00065 }
00066
00067 };
00068
00075 typedef std::basic_string<char, std::char_traits<char>, secallocator<char> > secstring;
00076
00077 }
00078
00079 #endif // _SECSTRING_H