• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ui/secstring.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //
00003 // $Id: secstring.h 3342 2010-09-17 18:32:00Z java $
00004 //
00005 // Copyright (C) 2008-2010  Rafael Ostertag
00006 //
00007 // This file is part of YAPET.
00008 //
00009 // YAPET is free software: you can redistribute it and/or modify it under the
00010 // terms of the GNU General Public License as published by the Free Software
00011 // Foundation, either version 3 of the License, or (at your option) any later
00012 // version.
00013 //
00014 // YAPET is distributed in the hope that it will be useful, but WITHOUT ANY
00015 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00016 // FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00017 // details.
00018 //
00019 // You should have received a copy of the GNU General Public License along with
00020 // YAPET.  If not, see <http://www.gnu.org/licenses/>.
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 YAPET {
00051     namespace UI {
00052 
00059         template <class T>
00060         class secallocator: public std::allocator<T> {
00061             public:
00062                 void deallocate (typename std::allocator<T>::pointer p,
00063                                  typename std::allocator<T>::size_type n) {
00064                     memset (p, '0', n*sizeof (std::allocator<T>::value_type) );
00065                     std::allocator<T>::deallocate (p, n);
00066                 }
00067 
00068         };
00069 
00076         typedef std::basic_string<char, std::char_traits<char>, secallocator<char> > secstring;
00077 
00078     }
00079 }
00080 #endif // _SECSTRING_H

Generated on Sun Sep 19 2010 15:37:13 for YAPET by  doxygen 1.7.1