資源簡介
實現的一個圖像縮放類,使用模板和STL技術,其中內存管理都是自己實現的,有異常處理類,很有參考價值。

代碼片段和文件信息
//?bstring.cpp
//
//?Copyright?(c)?2003?Philip?Romanik?Amy?Muntz
//
//?Permission?to?use?copy?modify?distribute?and?sell?this?software?and
//?its?documentation?for?any?purpose?is?hereby?granted?without?fee?provided
//?that?(i)?the?above?copyright?notices?and?this?permission?notice?appear?in
//?all?copies?of?the?software?and?related?documentation?and?(ii)?the?names
//?of?Philip?Romanik?and?Amy?Muntz?may?not?be?used?in?any?advertising?or
//?publicity?relating?to?the?software?without?the?specific?prior?written
//?permission?of?Philip?Romanik?and?Amy?Muntz.
//
//?Use?of?this?software?and/or?its?documentation?will?be?deemed?to?be
//?acceptance?of?these?terms.
//
//?THE?SOFTWARE?IS?PROVIDED?“AS-IS“?AND?WITHOUT?WARRANTY?OF?ANY?KIND
//?EXPRESS?IMPLIED?OR?OTHERWISE?INCLUDING?WITHOUT?LIMITATION?ANY
//?WARRANTY?OF?MERCHANTABILITY?OR?FITNESS?FOR?A?PARTICULAR?PURPOSE.
//
//?IN?NO?EVENT?SHALL?PHILIP?ROMANIK?OR?AMY?MUNTZ?BE?LIABLE?FOR
//?ANY?SPECIAL?INCIDENTAL?INDIRECT?OR?CONSEQUENTIAL?DAMAGES?OF?ANY?KIND
//?OR?ANY?DAMAGES?WHATSOEVER?RESULTING?FROM?LOSS?OF?USE?DATA?OR?PROFITS
//?WHETHER?OR?NOT?ADVISED?OF?THE?POSSIBILITY?OF?DAMAGE?AND?ON?ANY?THEORY?OF
//?LIABILITY?ARISING?OUT?OF?OR?IN?CONNECTION?WITH?THE?USE?OR?PERFORMANCE
//?OF?THIS?SOFTWARE.
//
//
//?Binary?string?class
#include?“bstring.h“
//?Ruler
//???????1?????????2?????????3?????????4?????????5?????????6????6
//345678901234567890123456789012345678901234567890123456789012345
#include???//?For?sprintf()
//?***************
//?*?????????????*
//?*??apBString??*
//?*?????????????*
//?***************
apBString::apBString??()?:?offset_?(0)?match_?(true)?{}
apBString::~apBString?()?{}
apBString::apBString?(const?apBString&?src)?
:?offset_?(src.offset_)?match_?(src.match_)?
??string_?(src.string_)
{}
apBString::apBString??(const?void*?data?unsigned?int?size)
:?offset_?(0)?match_?(true)
{
??string_.append?(reinterpret_cast(data)?size);
}
apBString&?apBString::operator=?(const?apBString&?src)
{
??if?(this?!=?&src)?{
????offset_?=?src.offset_;
????match_??=?src.match_;
????string_?=?src.string_;
??}
??return?*this;
}
void?apBString::add?(eTypes?type?const?void*?data?unsigned?int?size)
{
??//?Append?the?type
??Pel8?t?=?static_cast(type);
??string_.append?(reinterpret_cast(&t)?sizeof?(Pel8));
??//?Append?the?data
??string_.append?(reinterpret_cast(data)?size);
}
const?void*?apBString::extract?(eTypes&?type)
{
??if?(eof())?{
????type?=?eNone;
????return?0;
??}
??const?Pel8*?p?=?
????reinterpret_cast(string_.c_str()?+?offset_);
??type?=?(eTypes)?(*p++);
??int?size?=?0;
??switch?(type)?{
??case?ePel8:
????size?=?sizeof?(Pel8);
????break;
??case?ePel16:
????size?=?sizeof?(Pel16);
????break;
??case?ePel32s:
????size?=?sizeof?(Pel32s);
????break;
??case?ePel32:
????size?=?sizeof?(int);
????break;
??case?eFloat:
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2006-09-30?21:17??Delegates\JPEG\
?????文件????????3101??2003-02-26?10:55??Delegates\JPEG\index.html
?????文件??????762613??2002-11-16?18:34??Delegates\JPEG\jpegsr6.zip
?????文件??????613261??2002-11-16?18:33??Delegates\JPEG\jpegsrc.v6b.tar.gz
?????目錄???????????0??2006-09-30?21:17??Delegates\TIFF\
?????文件????????3709??2003-02-26?10:55??Delegates\TIFF\index.html
?????文件????????8847??2002-11-16?18:27??Delegates\TIFF\libtiff-lzw-compression-kit-1.3.tar.gz
?????文件??????951139??2003-02-08?15:27??Delegates\TIFF\tiff-v3.5.7.tar.gz
?????文件??????398722??2002-11-16?18:28??Delegates\TIFF\TIFF6.pdf
?????目錄???????????0??2006-09-30?21:17??Delegates\
?????目錄???????????0??2006-09-30?21:17??fr
?????文件???????13914??2003-01-30?17:09??fr
?????文件????????1800??2002-11-17?12:43??fr
?????文件????????4125??2002-11-17?15:53??fr
?????文件????????4143??2002-11-16?12:17??fr
?????文件????????3570??2002-11-17?12:44??fr
?????文件????????2938??2002-11-30?23:01??fr
?????文件????????6926??2002-12-15?15:53??fr
?????文件????????2538??2002-11-17?15:53??fr
?????文件????????1906??2002-11-17?13:19??fr
?????文件????????6547??2002-11-17?16:11??fr
?????文件????????2787??2002-11-17?12:45??fr
?????文件????????4668??2002-11-17?13:20??fr
?????目錄???????????0??2006-09-30?21:17??fr
?????文件????????8132??2003-02-08?18:46??fr
?????文件????????2708??2002-11-17?15:41??fr
?????文件????????9160??2003-02-08?18:46??fr
?????文件????????7144??2003-02-08?18:49??fr
?????目錄???????????0??2006-09-30?21:17??fr
?????文件????????2159??2002-11-17?12:48??fr
?????文件????????6674??2002-12-28?18:13??fr
............此處省略223個文件信息
- 上一篇:計算機網絡課程實驗:FTP協議的實現VC++
- 下一篇:MFC記事本開發
評論
共有 條評論