Click here to Skip to main content
15,896,063 members
Articles / Containers / Virtual Machine

An extendable report editor

Rate me:
Please Sign up or sign in to vote.
5.00/5 (11 votes)
3 Sep 2008CPOL3 min read 41.2K   2K   35  
An extendable report editor. You can simply add your own controls without recompiling the program or writing annoying plug-ins.
#ifndef __CMEM_H
#define __CMEM_H

#include "common.h"
#include "syslog.h"
#include "filebase.h"
#include "mem_tool.h"

#define LOCAL_MEM(name) char __##name[LBUF_SIZE];\
name.Init();\
name.SetP(__##name,LBUF_SIZE);\
name.SetSize(0)\

#define LOCAL_MEM_WITH_SIZE(name,size) char __##name[size];\
name.Init();\
name.SetP(__##name,size);\
name.SetSize(0)\

class CMem:public CFileBase{
public:
    char *p;
    long size; //size is changable
    long offset;
	BOOL self_alloc;
	long max_size; 
public:
	int StartWith(char *str,int case_sensive);
	int Copy(CMem *mem);
	long GetMaxSize();
	int SetStr(char *str);
	int StrICmp(char *str);
	int StrCmp(char *str);
	int SizeToMax();
	int AddBlock(long bsize);
	long GetSize();
	long GetOffset();
	CMem();
	~CMem();
	int Destroy();
	long Malloc(long asize);
	long Read(void *buf,long n);
	int Zero();	
	int Init();
	int Print();
	int SetP(char *p,long s);
	int Seek(long off);
	int StdStr();
	int SetSize(long ssize);
	long Write(void *buf,long n);

};

#endif

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 Code Project Open License (CPOL)


Written By
Software Developer
China China
26 years old, 2 years work experience.

Comments and Discussions