⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constants.hpp

📁 C++的一个好库。。。现在很流行
💻 HPP
字号:
// (C) Copyright Jonathan Turkanis 2004
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)

// See http://www.boost.org/libs/iostreams for documentation.

// Contains the definitions of several constants used by the test program.

#ifndef BOOST_IOSTREAMS_TEST_CONSTANTS_HPP_INCLUDED
#define BOOST_IOSTREAMS_TEST_CONSTANTS_HPP_INCLUDED

#include <string.h>
#include <boost/config.hpp>

namespace boost { namespace iostreams { namespace test {

// Note: openmode could be a class type, so this header must be included
// by just one TU.
const BOOST_IOS::openmode in_mode = BOOST_IOS::in | BOOST_IOS::binary;
const BOOST_IOS::openmode out_mode = BOOST_IOS::out | BOOST_IOS::binary;

// Chunk size for reading or writing in chunks.
const int chunk_size = 59;       

// Chunk size for reading or writing in chunks.
const int small_buffer_size = 23;       

// Number of times data is repeated in test files.
const int data_reps = 300;

namespace detail {

// Returns string which is used to generate test files.
inline const char* data(char*) 
{
    static const char* c =
        "!\"#$%&'()*+,-./0123456879:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n";
    return c;
}

// Returns string which is used to generate test files.
inline const wchar_t* data(wchar_t*) 
{
    static const wchar_t* c =
        L"!\"#$%&'()*+,-./0123456879:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        L"[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n";
    return c;
}

} // End namespace detail.

inline const char* narrow_data() { return detail::data((char*)0); }

inline const wchar_t* wide_data() { return detail::data((wchar_t*)0); }

// Length of string returned by data().
inline int data_length() 
{ 
    static int len = (int) strlen(narrow_data());
    return len;
}

} } } // End namespaces detail, iostreams, boost.

#endif // #ifndef BOOST_IOSTREAMS_TEST_CONSTANTS_HPP_INCLUDED

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -