Wexus2 0.20
wexus2.src/wexus/TemplateToken.h
00001 
00002 /*
00003  * Copyright (c) 2011 Aleksander B. Demko
00004  * This source code is distributed under the MIT license.
00005  * See the accompanying file LICENSE.MIT.txt for details.
00006  */
00007 
00008 #ifndef __INCLUDED_WEXUS_TEMPLATETOKEN_H__
00009 #define __INCLUDED_WEXUS_TEMPLATETOKEN_H__
00010 
00011 #include <QByteArray>
00012 
00013 namespace wexus
00014 {
00015   class TemplateToken;
00016 }
00017 
00018 /**
00019  * A Parsed token from a template.
00020  *
00021  * @author Aleksander Demko
00022  */ 
00023 class wexus::TemplateToken
00024 {
00025   public:
00026     /**
00027      * Constructor.
00028      *
00029      * @param lineno the line numbers this token was found
00030      * @param typ the type of token, one of ' ' '=' or 'L' (literal)
00031      * @param cod the literal code/byte stream
00032      *
00033      * @author Aleksander Demko
00034      */ 
00035     TemplateToken(int lineno, char typ, const QByteArray &cod);
00036 
00037     int lineno(void) const { return dm_lineno; }
00038     char type(void) const { return dm_type; }
00039     const QByteArray &data(void) const { return dm_data; }
00040     QByteArray &data(void) { return dm_data; }
00041 
00042   private:
00043     int dm_lineno;
00044     char dm_type;    // one of ' ' '=' 'L' (literal)
00045     QByteArray dm_data;
00046 };
00047 
00048 #endif
00049 
 All Classes Namespaces Functions Variables Enumerations Enumerator