Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
/* $XConsortium: DataTask.C /main/3 1996/08/21 15:46:25 drk $ */
/* exported interfaces... */
#include "DataTask.h"
/* imported interfaces... */
#include "Token.h"
DataTask::DataTask(const Token&) : buf()
{
level = 1;
}
void DataTask::markup(const Token &t)
{
switch(t.type()){
case START:
/*
* be careful not to start collecting again after the relavent
* element is done!
*/
if(level > 0) level++;
break;
case END:
if(level > 0) level--;
}
}
void DataTask::data(const char *chars, size_t len)
{
if(level > 0){
buf.write(chars, len);
}
}
const char * DataTask::content(size_t *len)
{
if(len) *len = buf.GetSize();
return buf.GetBuffer();
}