view usr/src/cmd/man/src/util/nsgmls.src/include/StorageManager.h @ 4:1a15d5aaf794

synchronized with onnv_86 (6202) in onnv-gate
author Koji Uno <>
date Mon, 31 Aug 2009 14:38:03 +0900
parents c9caec207d52
line wrap: on
line source

// Copyright (c) 1994, 1995 James Clark
// See the file COPYING for copying permission.
#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifndef StorageManager_INCLUDED
#define StorageManager_INCLUDED 1
#ifdef __GNUG__
#pragma interface

#include "StringC.h"
#include "types.h"
#include "CharsetInfo.h"
#include <stddef.h>

namespace SP_NAMESPACE {

class StorageManager;
class CharsetInfo;
class Messenger;
class InputCodingSystem;

class SP_API StorageObject {
  virtual ~StorageObject();
  virtual Boolean read(char *buf, size_t bufSize, Messenger &,
		       size_t &nread) = 0;
  virtual Boolean rewind(Messenger &) = 0;
  virtual void willNotRewind();
  virtual size_t getBlockSize() const;
  StorageObject(const StorageObject &);	// undefined
  void operator=(const StorageObject &); // undefined

class SP_API StorageManager {
  virtual StorageObject *makeStorageObject(const StringC &specId,
					   const StringC &baseId,
					   Boolean search,
					   Boolean mayRewind,
					   Messenger &mgr,
					   StringC &actualId) = 0;
  virtual const char *type() const = 0;
  virtual Boolean inheritable() const;
  virtual Boolean transformNeutral(StringC &, Boolean fold, Messenger &) const;
  // Resolve a possibly relative ID by examining the base and specified IDs.
  // Put the resolved ID in specID.
  // Return 0 if it cannot be resolved yet becase the specified ID is relative
  // and physical searching is required to resolve it and search is true;
  // in this case the base will be passed to makeStorageObject.
  // Otherwise return 1; in this case the base will be discarded, and the
  // resolved ID will be passed to makeStorageObject.
  virtual Boolean resolveRelative(const StringC &base,
				  StringC &specId,
				  Boolean search) const;
  virtual Boolean guessIsId(const StringC &, const CharsetInfo &) const;
  virtual const InputCodingSystem *requiredCodingSystem() const;
  virtual Boolean requiresCr() const;
  virtual ~StorageManager();
  virtual const CharsetInfo *idCharset() const;
  virtual const StringC *reString() const;
  StorageManager(const StorageManager &); // undefined
  void operator=(const StorageManager &); // undefined

class SP_API IdStorageManager : public StorageManager {
  IdStorageManager(const CharsetInfo *idCharset);
  const CharsetInfo *idCharset() const;
  const StringC *reString() const;
  StringC reString_;
  IdStorageManager(const IdStorageManager &); // undefined
  void operator=(const IdStorageManager &); // undefined

  const CharsetInfo *idCharset_;


#endif /* not StorageManager_INCLUDED */