byte_format.h

Go to the documentation of this file.
00001 #ifndef BYTE_FORMATTER_GROUP
00002 #define BYTE_FORMATTER_GROUP
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : byte formatters                                                   *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1992-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "textual_dll.h"
00019 
00020 // forward.
00021 class byte_array;
00022 class istring;
00023 
00025 
00026 namespace byte_format {
00027 
00028 // NOTE: text_dump assumes at least a 32 bit integer.
00029 
00030 void TEXTUAL_FUNCTION_STYLE print_char(byte to_print, istring &out,
00031         char replace = '_');
00033 
00035 void TEXTUAL_FUNCTION_STYLE print_chars(const byte *to_print, int length,
00036         istring &out, char replace = '_');
00038 
00039 void TEXTUAL_FUNCTION_STYLE text_dump(istring &output, const byte *location,
00040         u_int length, u_int label = 0, const char *eol = "\n");
00042 
00048 istring TEXTUAL_FUNCTION_STYLE text_dump(const byte *location, u_int length,
00049         u_int label = 0, const char *eol = "\n");
00051 
00053 void TEXTUAL_FUNCTION_STYLE text_dump(istring &output,
00054         const byte_array &to_dump, u_int label = 0, const char *eol = "\n");
00056 istring TEXTUAL_FUNCTION_STYLE text_dump(const byte_array &to_dump,
00057         u_int label = 0, const char *eol = "\n");
00059 
00061 void TEXTUAL_FUNCTION_STYLE parse_dump(const istring &dumped_form,
00062         byte_array &bytes_found);
00063 
00065 
00066 void TEXTUAL_FUNCTION_STYLE bytes_to_string(const byte_array &to_convert,
00067         istring &as_string, bool space_delimited = true);
00069 
00073 void TEXTUAL_FUNCTION_STYLE string_to_bytes(const istring &to_convert,
00074         byte_array &as_array);
00076 
00082 void TEXTUAL_FUNCTION_STYLE bytes_to_string(const byte *to_convert, int length,
00083         istring &as_string, bool space_delimited = true);
00085 
00086 void TEXTUAL_FUNCTION_STYLE string_to_bytes(const char *to_convert,
00087         byte_array &as_array);
00089 
00091 
00092 void TEXTUAL_FUNCTION_STYLE bytes_to_shifted_string
00093         (const byte_array &to_convert, istring &as_string);
00095 
00101 void TEXTUAL_FUNCTION_STYLE shifted_string_to_bytes(const istring &to_convert,
00102         byte_array &as_array);
00104 
00108 }
00109 
00110 #endif
00111 

Generated on Wed Nov 19 04:28:56 2008 for HOOPLE Libraries by  doxygen 1.5.1