~ubuntu-branches/ubuntu/maverick/speech-tools/maverick

« back to all changes in this revision

Viewing changes to include/EST_Val.h

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry, Kumar Appaiah, Kartik Mistry
  • Date: 2007-11-19 17:39:39 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071119173939-l5zuh2waxmrel31x
Tags: 1:1.2.96~beta-1
[Kumar Appaiah]
* Long awaited new upstream version (Closes: #437682)
* debian/patches:
  + Split all patches, and use quilt for patch management
  + Use latest config.guess, config.sub
* Minor manpage description fix
* debian/rules:
  + Fix old autoconf files, using autotools-dev
  + Find versions using debian/get_versions.sh, instead of hard coding

[Kartik Mistry]
* Added debian/watch file from Kumar
* debian/control:
  + Added homepage entry
  + Added Kumar Appaiah as co-maintainer list
  + Added XS-Dm-Upload-Allowed: yes to allow Debian-Maintainer upload
* debian/copyright: moved copyright out of license section
* debian/manpage.1: fixed lintian warning
* debian/rules: includes base_class/*.cc which is badly needed for
  festival compilation

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
/*                    Date   :  May 1996                                 */
35
35
/*-----------------------------------------------------------------------*/
36
36
/*                                                                       */
37
 
/* A egenric container class, originally for ints floats and string now  */
 
37
/* A generic container class, originally for ints floats and string now  */
38
38
/* extended for some others, eventually allow run addition of new types  */
39
39
/* "built-in" types (i.e. ones explicitly mentioned in this file) may    */
40
40
/* be accessed by member functions, objects added at run time may only   */
41
41
/* be accessed by functions                                              */
42
42
/*                                                                       */
43
43
/* This is so similar to the LISP class in SIOD it could be viewed as a  */
44
 
/* little embarassing, but this is done without a cons cell heap or gc   */
 
44
/* little embarrassing, but this is done without a cons cell heap or gc  */
45
45
/* which may or may not be a good thing.                                 */
46
46
/*                                                                       */
47
47
/*=======================================================================*/
103
103
    EST_Val(const double d) {t=val_float; v.fval=d;}
104
104
 
105
105
    /** Copy constructor for a string*/
106
 
    EST_Val(const EST_String &s) {t=val_string; sval = s;}
 
106
    //    EST_Val(const EST_String &s) {t=val_string; sval = s;}
 
107
    EST_Val(const EST_String &s) : t(val_string), sval(s) {};
107
108
 
108
109
    /** Copy constructor for a string literal*/
109
 
    EST_Val(const char *s) {t=val_string; sval = s;}
110
 
 
 
110
    //    EST_Val(const char *s) {t=val_string; sval = s;}
 
111
    EST_Val(const char *s) : t(val_string), sval(s) {};
111
112
 
112
113
    EST_Val(val_type type,void *p, void (*f)(void *));
113
114
 
133
134
    const int I(void) const 
134
135
        { return Int(); }
135
136
 
136
 
    /** returns the value, cast as an float */
 
137
    /** returns the value, cast as a float */
137
138
    const float Float(void) const 
138
139
        {if (t==val_float) return v.fval; return to_flt();}
139
140
 
140
 
    /** returns the value, cast as an float */
 
141
    /** returns the value, cast as a float */
141
142
    const float F(void) const 
142
143
        { return Float(); }
143
144
 
144
 
    /** returns the value, cast as an string */
 
145
    /** returns the value, cast as a string */
145
146
    const EST_String &String(void) const
146
147
       {if (t!=val_string) to_str(); return sval;}
147
148
 
148
 
    /** returns the value, cast as an string */
 
149
    /** returns the value, cast as a string */
149
150
    const EST_String &string(void) const
150
151
       {return String();}
151
152
 
152
 
    /** returns the value, cast as an string */
 
153
    /** returns the value, cast as a string */
153
154
    const EST_String &S(void) const
154
155
       {return String();}
155
156
 
156
 
    /** returns the value, cast as an string */
 
157
    /** returns the value, cast as a string */
157
158
    const EST_String &string_only(void) const {return sval;}
158
159
 
159
160
    //@}
252
253
 
253
254
inline const char *error_name(const EST_Val val) { return (EST_String)val;}
254
255
 
255
 
 
256
256
// For consistency with other (user-defined) types in val
257
 
//
258
 
inline EST_String String(const EST_Val &v) { return v.string(); }
259
257
inline EST_Val est_val(const EST_String s) { return EST_Val(s); }
260
258
inline EST_Val est_val(const char *s) { return EST_Val(s); }
261
259
inline int Int(const EST_Val &v) { return v.Int(); }