Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
69
cde/programs/nsgmls/SdText.h
Normal file
69
cde/programs/nsgmls/SdText.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/* $XConsortium: SdText.h /main/1 1996/07/29 17:03:58 cde-hp $ */
|
||||
// Copyright (c) 1995 James Clark
|
||||
// See the file COPYING for copying permission.
|
||||
|
||||
#ifndef SdText_INCLUDED
|
||||
#define SdText_INCLUDED 1
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "StringOf.h"
|
||||
#include "Vector.h"
|
||||
#include "Location.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
#endif
|
||||
|
||||
struct SP_API SdTextItem {
|
||||
SdTextItem();
|
||||
Location loc;
|
||||
size_t index;
|
||||
};
|
||||
|
||||
class SP_API SdText {
|
||||
public:
|
||||
SdText();
|
||||
SdText(const Location &loc, Boolean lita);
|
||||
void swap(SdText &);
|
||||
void addChar(SyntaxChar, const Location &);
|
||||
const String<SyntaxChar> &string() const;
|
||||
Boolean lita() const;
|
||||
Location endDelimLocation() const;
|
||||
private:
|
||||
Boolean lita_;
|
||||
String<SyntaxChar> chars_;
|
||||
Vector<SdTextItem> items_;
|
||||
friend class SdTextIter;
|
||||
};
|
||||
|
||||
class SP_API SdTextIter {
|
||||
public:
|
||||
SdTextIter(const SdText &);
|
||||
Boolean next(const SyntaxChar *&, size_t &, Location &);
|
||||
private:
|
||||
const SdText *ptr_;
|
||||
size_t itemIndex_;
|
||||
};
|
||||
|
||||
inline
|
||||
Boolean SdText::lita() const
|
||||
{
|
||||
return lita_;
|
||||
}
|
||||
|
||||
inline
|
||||
const String<SyntaxChar> &SdText::string() const
|
||||
{
|
||||
return chars_;
|
||||
}
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not SdText_INCLUDED */
|
||||
Reference in New Issue
Block a user