YCPString.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |  
00003 |                      __   __    ____ _____ ____                      |  
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |  
00005 |                       \ V / _` \___ \ | |   __) |                    |  
00006 |                        | | (_| |___) || |  / __/                     |  
00007 |                        |_|\__,_|____/ |_| |_____|                    |  
00008 |                                                                      |  
00009 |                               core system                            | 
00010 |                                                        (C) SuSE GmbH |  
00011 \----------------------------------------------------------------------/ 
00012 
00013    File:       YCPString.h
00014 
00015    Author:     Mathias Kettner <kettner@suse.de>
00016    Maintainer: Thomas Roelz <tom@suse.de>
00017 
00018 /-*/
00019 // -*- c++ -*-
00020 
00021 #ifndef YCPString_h
00022 #define YCPString_h
00023 
00024 
00025 #include "YCPValue.h"
00026 #include <y2util/Ustring.h>
00027 
00028    
00039 class YCPStringRep : public YCPValueRep
00040 {
00041     string v;
00042 
00043 protected:
00044     friend class YCPString;
00045 
00053     YCPStringRep(string s);
00054 
00055 public:
00060     string value() const;
00061 
00070     YCPOrder compare(const YCPString &v, bool rl = false) const;
00071 
00075     const char *value_cstr() const;
00076 
00083     string toString() const;
00084 
00088     std::ostream & toStream (std::ostream & str) const;
00089     std::ostream & toXml (std::ostream & str, int indent ) const;
00090 
00094     YCPValueType valuetype() const;
00095 };
00096 
00103 class YCPString : public YCPValue
00104 {
00105     DEF_COMMON(String, Value);
00106 public:
00107     YCPString(string s) : YCPValue(new YCPStringRep(s)) {}
00108     YCPString(bytecodeistream & str);
00109 };
00110 
00111 #endif   // YCPString_h
00112     

Generated on Tue Nov 6 01:27:46 2007 for yast2-core by  doxygen 1.5.3