touched up sample codes

This commit is contained in:
2009-08-14 07:26:46 +00:00
parent ce695db836
commit 1caca1fa41
5 changed files with 151 additions and 112 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.hpp 251 2009-08-10 07:11:16Z hyunghwan.chung $
* $Id: Awk.hpp 254 2009-08-13 13:26:46Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -25,6 +25,11 @@
#include <qse/Mmgr.hpp>
#include <stdarg.h>
/** @file
* AWK Interpreter
*/
/////////////////////////////////
QSE_BEGIN_NAMESPACE(QSE)
/////////////////////////////////
@ -475,6 +480,9 @@ public:
void operator delete (void* p);
void operator delete[] (void* p);
/**
* Represents an index of an arrayed value
*/
class Index
{
public:
@ -488,6 +496,9 @@ public:
size_t len;
};
/**
* Represents a numeric index of an arrayed value
*/
class IntIndex: public Index
{
public:
@ -512,6 +523,9 @@ public:
#endif
};
/**
* helper class to iterate over array elements
*/
class IndexIterator
{
public:
@ -656,6 +670,7 @@ public:
const char_t* str
);
/** determines if a value is arrayed */
bool isIndexed () const;
int getIndexed (

View File

@ -1,5 +1,5 @@
/*
* $Id: StdAwk.hpp 250 2009-08-10 03:29:59Z hyunghwan.chung $
* $Id: StdAwk.hpp 254 2009-08-13 13:26:46Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -21,13 +21,16 @@
#include <qse/awk/Awk.hpp>
/**
/** @file
*
* @example awk05.cpp
* This program demonstrates how to embed QSE::StdAwk::loop().
* This program demonstrates how to use QSE::StdAwk::loop().
* @example awk06.cpp
* This program demonstrates how to use QSE::StdAwk::call().
* @example awk07.cpp
* This program demonstrates how to handle an indexed value.
* @example awk08.cpp
* This program shows how to add intrinsic functions.
*/
/////////////////////////////////
@ -35,13 +38,16 @@ QSE_BEGIN_NAMESPACE(QSE)
////////////////////////////////
/**
* Provides a more useful AWK interpreter by overriding primitive methods,
* the file handler, the pipe handler and implementing common AWK intrinsic
* Provides a more useful interpreter by overriding primitive methods,
* the file handler, the pipe handler and implementing common intrinsic
* functions.
*/
class StdAwk: public Awk
{
public:
/**
* Implements script input from a file and deparsing into a file.
*/
class SourceFile: public Source
{
public:
@ -60,6 +66,10 @@ public:
qse_cstr_t dir;
};
/**
* Implements script input from a string. The deparsing is not
* supported.
*/
class SourceString: public Source
{
public:

View File

@ -1,5 +1,5 @@
/*
* $Id: Sed.hpp 235 2009-07-15 10:43:31Z hyunghwan.chung $
* $Id: Sed.hpp 254 2009-08-13 13:26:46Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -22,7 +22,7 @@
#include <qse/Mmgr.hpp>
#include <qse/sed/sed.h>
/**@file
/** @file
* A stream editor
*/

View File

@ -1,5 +1,5 @@
/*
* $Id: StdSed.hpp 235 2009-07-15 10:43:31Z hyunghwan.chung $
* $Id: StdSed.hpp 254 2009-08-13 13:26:46Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -21,6 +21,10 @@
#include <qse/sed/Sed.hpp>
/** @file
* standard sed
*/
/////////////////////////////////
QSE_BEGIN_NAMESPACE(QSE)
/////////////////////////////////