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