Click here to Skip to main content
15,892,298 members
Articles / Web Development / HTML

Catch All Bugs with BugTrap!

Rate me:
Please Sign up or sign in to vote.
4.34/5 (84 votes)
31 Jan 2009MIT5 min read 1.9M   9.1K   293  
A tool that can catch unhandled errors and exceptions, and deliver error reports to remote support servers
/*
 * This is a part of the BugTrap package.
 * Copyright (c) 2005-2007 IntelleSoft.
 * All rights reserved.
 *
 * Description: Output stream.
 * Author: Maksim Pyatkovskiy.
 *
 * This source code is only intended as a supplement to the
 * BugTrap package reference and related electronic documentation
 * provided with the product. See these sources for detailed
 * information regarding the BugTrap package.
 */

#pragma once

#include "BaseStream.h"

class CInputStream;

/// Output stream.
class COutputStream : public virtual CBaseStream
{
public:
	/// Set data length.
	virtual int SetLength(int nLength);
	/// Write one byte to the stream. This function is required.
	virtual bool WriteByte(unsigned char bValue) = 0;
	/// Write multiple values to the buffer. This function is optional.
	virtual int WriteByte(unsigned char bValue, int nCount);
	/// Write array of bytes to the stream. This function is optional.
	virtual int WriteBytes(const unsigned char* arrBytes, int nCount);
	/// Concatenate two streams. This function is optional.
	virtual int WriteStream(CInputStream* pInputStream);
};

/**
 * @param nLength - new stream length.
 * @return number of bytes in the stream.
 */
inline int COutputStream::SetLength(int /*nLength*/)
{
	return -1;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions