您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ zError函数代码示例

51自学网 2021-06-03 11:55:17
  C++
这篇教程C++ zError函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中zError函数的典型用法代码示例。如果您正苦于以下问题:C++ zError函数的具体用法?C++ zError怎么用?C++ zError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了zError函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetDlgItem

void CDlg_Compress::OnBnClickedBtnCompress(){    // 因为压缩函数的输出缓冲必须比输入大0.1% + 12 然后一个DWORD用来保存压缩前的大小    // int compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);    CString strFileName;    CString strCompress;    GetDlgItem(IDC_COMPRESS_EDIT_FILENAME)->GetWindowText(strFileName);    GetDlgItem(IDC_COMPRESS_EDIT_CONTENT)->GetWindowText(strCompress);    int inLen = strCompress.GetLength();    unsigned char *out = new unsigned char[inLen*2];    unsigned long outLen = inLen*2;    int ret = compress(out, &outLen, (LPBYTE)(LPCSTR)strCompress, inLen);    if (0 == ret)    {        CFile File;        if (File.Open(strFileName, CFile::modeCreate | CFile::modeReadWrite))        {            File.Write(out, outLen);            File.Close();        }        MessageBox("Compress OK!");    }    else    {        strCompress.Format("Error:%s", zError(ret));        MessageBox(strCompress);    }    delete[] out; }
开发者ID:tempbottle,项目名称:TestSet,代码行数:33,


示例2: deflate

int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length){	if (!_pIstr) return 0;	if (_zstr.avail_in == 0 && !_eof)	{		int n = 0;		if (_pIstr->good())		{			_pIstr->read(_buffer, DEFLATE_BUFFER_SIZE);			n = static_cast<int>(_pIstr->gcount());		}		if (n > 0)		{			_zstr.next_in  = (unsigned char*) _buffer;			_zstr.avail_in = n;		}		else		{			_zstr.next_in  = 0;			_zstr.avail_in = 0;			_eof = true;		}	}	_zstr.next_out  = (unsigned char*) buffer;	_zstr.avail_out = static_cast<unsigned>(length);	for (;;)	{		int rc = deflate(&_zstr, _eof ? Z_FINISH : Z_NO_FLUSH);		if (_eof && rc == Z_STREAM_END) 		{			_pIstr = 0;			return static_cast<int>(length) - _zstr.avail_out;		}		if (rc != Z_OK) throw IOException(zError(rc)); 		if (_zstr.avail_out == 0)		{			return static_cast<int>(length);		}		if (_zstr.avail_in == 0)		{			int n = 0;			if (_pIstr->good())			{				_pIstr->read(_buffer, DEFLATE_BUFFER_SIZE);				n = static_cast<int>(_pIstr->gcount());			}			if (n > 0)			{				_zstr.next_in  = (unsigned char*) _buffer;				_zstr.avail_in = n;			}			else			{				_zstr.next_in  = 0;				_zstr.avail_in = 0;				_eof = true;			}		}	}}
开发者ID:Adoni,项目名称:WiEngine,代码行数:60,


示例3: DeflateInit

void DeflateInit(z_stream *stream) {  // メモリの
C++ zValue函数代码示例
C++ z函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。