Archive for April, 2007
How make “N” bit Integer??
#include <iostream>
using namespace std;
template <int Size>
class NInt
{
private:
int Int:Size;
public:
int GetValue();
void SetValue(int value);
void PrintValue();
};
template <int Size>
int NInt<Size>::GetValue()
{
return this->Int;
}
template <int Size>
void NInt<Size>::SetValue(int value)
{
this->Int = value;
}
template <int Size>
void NInt<Size>::PrintValue()
{
cout<<”Value : “<<this->Int<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
NInt<2> obj;
obj.PrintValue();
obj.SetValue(1);
[...]
Filed under: C/C++ | Leave a Comment
How To Use Greta?
[Visit Link] http://www29.websamba.com/sswater/en/greta/index.htm
Filed under: C/C++ | Leave a Comment
Regular Expression in C++
GRETA:
The GRETA Regular Expression Template Archive
GRETA gives you all the power of Perl 5 regular expressions in your C++
applications. These easy-to-use classes let you perform regular
expression pattern matches on strings in C++.
Features include:
Fast backtracking regular expression engine.
Separately compiled patterns.
Matches against C-style NULL-terminated strings, C++-sytle std::string’s, or iterator ranges.
Template on iterator type and syntax module.
Supports [...]
Filed under: C/C++ | 1 Comment
#include
#include
#include
#include
int DeleteDirectory(const std::string &refcstrRootDirectory,
bool bDeleteSubdirectories = true)
{
bool bSubdirectory = false; // Flag, indicating whether
// subdirectories have been found
HANDLE hFile; // Handle to directory
std::string strFilePath; // Filepath
std::string strPattern; // Pattern
WIN32_FIND_DATA FileInformation; // File information
strPattern = refcstrRootDirectory + “\\*.*”;
hFile = ::FindFirstFile(strPattern.c_str(), &FileInformation);
if(hFile != INVALID_HANDLE_VALUE)
{
[...]
Filed under: C/C++ | Leave a Comment




