system_string.h

Go to the documentation of this file.
00001 #ifndef SYSTEM_STRING_CLASS
00002 #define SYSTEM_STRING_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : system_string                                                     *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *  Purpose:                                                                   *
00010 *                                                                             *
00011 *    Insert purpose here....                                                  *
00012 *    Encapsulates the details of transforming various character string        *
00013 *  formats into the underlying window system string format.                   *
00014 *                                                                             *
00015 *******************************************************************************
00016 * Copyright (c) 1991-$now By Author.  This program is free software; you can  *
00017 * redistribute it and/or modify it under the terms of the GNU General Public  *
00018 * License as published by the Free Software Foundation; either version 2 of   *
00019 * the License or (at your option) any later version.  This is online at:      *
00020 *     http://www.fsf.org/copyleft/gpl.html                                    *
00021 * Please send any updates to: fred@gruntose.com                               *
00022 \*****************************************************************************/
00023 
00024 // note: This class is a pretty ugly collection of kludges currently and should
00025 // be cleaned up significantly.  One helpful idea would be better comments
00026 // for each of the methods.
00027 
00028 #include "definitions_passive.h"
00029 
00030 // CAUTION: INDEX_SEPARATE (below) temporarily does not work.
00031 
00032 enum concatenation_method
00033   { EOL_SEPARATE, SPACE_SEPARATE, INDEX_SEPARATE, DO_NOT_SEPARATE };
00034   // used in the constructor that works on multiple strings.  EOL_SEPARATE
00035   // means that the windowing system's string separators are used within the
00036   // created system_string at places where carriage returns (\n) are found.
00037   // SPACE_SEPARATE means that the strings are to be separated by a single
00038   // space character.  INDEX_SEPARATE means that the strings are separated
00039   // at the same places where each piece of text begins in the multiple
00040   // strings.  DO_NOT_SEPARATE means that the strings are jammed together
00041   // without separators.
00042 
00043 class WP_PASSIVE_CLASS_STYLE system_string
00044 {
00045 public:
00046   system_string(const char *str = NIL);
00047     // Converts a simple character string.
00048 
00049   system_string(const istring &str);
00050     // Converts one of our dynamic strings.
00051 
00052   system_string(int n, const char *lines[], concatenation_method how);
00053     // Converts a set of "n" lines of text.
00054 
00055   ~system_string();
00056 
00057   operator window_string () const;
00058     // returns this string in the form that the underlying windowing system
00059     // expects.
00060 
00061 private:
00062   window_string contents;
00063 };
00064 
00065 int compound_string_length(const char *to_count[]);
00066   // returns the number of string chunks held in "to_count", where the last
00067   // element in "to_count" should hold a zero character pointer.
00068 
00069 #endif

Generated on Fri Nov 28 04:29:05 2008 for HOOPLE Libraries by  doxygen 1.5.1