本文整理汇总了C++中setContentType函数的典型用法代码示例。如果您正苦于以下问题:C++ setContentType函数的具体用法?C++ setContentType怎么用?C++ setContentType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setContentType函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setGuid
MHSyncItemInfo::MHSyncItemInfo(MHSyncItemInfo& copy) {
iD = copy.getId();
setGuid(copy.getGuid());
setLuid(copy.getLuid());
setName(copy.getName());
setSize(copy.getSize());
setServerUrl(copy.getServerUrl());
setContentType(copy.getContentType());
setCreationDate(copy.getCreationDate());
setModificationDate(copy.getModificationDate());
setStatus(copy.getStatus());
setServerLastUpdate(copy.getServerLastUpdate());
setRemoteItemUrl(copy.getRemoteItemUrl());
setRemoteThumbUrl(copy.getRemoteThumbUrl());
setRemotePreviewUrl(copy.getRemotePreviewUrl());
setLocalThumbPath(copy.getLocalThumbPath());
setLocalPreviewPath(copy.getLocalPreviewPath());
setLocalItemPath(copy.getLocalItemPath());
setLocalItemETag(copy.getLocalItemETag().c_str());
setLocalThumbETag(copy.getLocalThumbETag().c_str());
setLocalPreviewETag(copy.getLocalPreviewETag().c_str());
setRemoteItemETag(copy.getRemoteItemETag().c_str());
setRemoteThumbETag(copy.getRemoteThumbETag().c_str());
setRemotePreviewETag(copy.getRemotePreviewETag().c_str());
setItemExifData(copy.exifData);
setItemVideoMetadata(copy.videoMetadata);
setExportedServices(copy.exportedServices);
setShared(copy.shared);
setNumUploadFailures(copy.numUploadFailures);
}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:33,代码来源:MHSyncItemInfo.cpp
示例2: setContentType
//-----------------------------------------------------------------------
void TextureUnitState::setAnimatedTextureName(const String* const names, unsigned int numFrames, Real duration)
{
setContentType(CONTENT_NAMED);
mTextureLoadFailed = false;
mFrames.resize(numFrames);
// resize pointers, but don't populate until needed
mFramePtrs.resize(numFrames);
mAnimDuration = duration;
mCurrentFrame = 0;
mCubic = false;
for (unsigned int i = 0; i < mFrames.size(); ++i)
{
mFrames[i] = names[i];
mFramePtrs[i].setNull();
}
// Load immediately if Material loaded
if (isLoaded())
{
_load();
}
// Tell parent to recalculate hash
if( Pass::getHashFunction() == Pass::getBuiltinHashFunction( Pass::MIN_TEXTURE_CHANGE ) )
{
mParent->_dirtyHash();
}
}
开发者ID:Anti-Mage,项目名称:ogre,代码行数:30,代码来源:OgreTextureUnitState.cpp
示例3: _pStoreFactory
MailMessage::MailMessage(PartStoreFactory* pStoreFactory):
_pStoreFactory(pStoreFactory)
{
Poco::Timestamp now;
setDate(now);
setContentType("text/plain");
}
开发者ID:1514louluo,项目名称:poco,代码行数:7,代码来源:MailMessage.cpp
示例4: SYSTEM_ERROR
bool HttpResponse::sendFile(String fileName, bool allowGzipFileCheck /* = true*/)
{
if (stream != NULL)
{
SYSTEM_ERROR("Stream already created");
delete stream;
stream = NULL;
}
String compressed = fileName + ".gz";
if (allowGzipFileCheck && fileExist(compressed))
{
debugf("found %s", compressed.c_str());
stream = new FileStream(compressed);
setHeader("Content-Encoding", "gzip");
}
else if (fileExist(fileName))
{
debugf("found %s", fileName.c_str());
stream = new FileStream(fileName);
}
else
{
notFound();
return false;
}
if (!hasHeader("Content-Type"))
{
const char *mime = ContentType::fromFullFileName(fileName);
if (mime != NULL)
setContentType(mime);
}
return true;
}
开发者ID:robotiko,项目名称:Sming_RTOS_POC,代码行数:35,代码来源:HttpResponse.cpp
示例5: setContentType
void QMessageContentContainerPrivate::setContent(const QByteArray &content, const QByteArray &type, const QByteArray &subType, const QByteArray &charset)
{
setContentType(type, subType, charset);
_content = content;
_available = true;
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:7,代码来源:qmessagecontentcontainer_symbian.cpp
示例6: N
IMM::IMM(BOOM::Vector<TrainingSequence*> &v,int order,
int minSampleSize,int phase,ContentType contentType,
Strand strand)
: N(order),
alphabetSize(alphabet.getNumElements()),
phase(phase),
revComp(NULL),
models(new BOOM::Vector<BOOM::StringMap<double>*>)
{
setContentType(contentType);
if(strand==EITHER_STRAND) strand=::getStrand(contentType);
setStrand(strand);
buildModels(v,minSampleSize);
if(strand==FORWARD_STRAND)
{
BOOM::Vector<TrainingSequence*> rcSeqs;
revCompSeqs(v,rcSeqs);
revComp=new IMM(rcSeqs,order,minSampleSize,phase,
::reverseComplement(contentType),
REVERSE_STRAND);
revComp->revComp=this;
}
}
开发者ID:bmajoros,项目名称:EGGS,代码行数:25,代码来源:IMM.C
示例7: poco_assert
void HTTPServerResponseImpl::sendFile(const std::string& path, const std::string& mediaType)
{
poco_assert (!_pStream);
File f(path);
Timestamp dateTime = f.getLastModified();
File::FileSize length = f.getSize();
set("Last-Modified", DateTimeFormatter::format(dateTime, DateTimeFormat::HTTP_FORMAT));
#if defined(POCO_HAVE_INT64)
setContentLength64(length);
#else
setContentLength(static_cast<int>(length));
#endif
setContentType(mediaType);
setChunkedTransferEncoding(false);
Poco::FileInputStream istr(path);
if (istr.good())
{
_pStream = new HTTPHeaderOutputStream(_session);
write(*_pStream);
if (_pRequest && _pRequest->getMethod() != HTTPRequest::HTTP_HEAD)
{
StreamCopier::copyStream(istr, *_pStream);
}
}
else throw OpenFileException(path);
}
开发者ID:jacktang,项目名称:ClickHouse,代码行数:28,代码来源:HTTPServerResponseImpl.cpp
示例8: log_debug
////////////////////////////////////////////////////////////////////////
// componentdefinition
//
unsigned Unzip::operator() (tnt::HttpRequest& request, tnt::HttpReply& reply, tnt::QueryParams& qparams)
{
std::string pi = request.getPathInfo();
log_debug("unzip archive \"" << request.getArg("file") << "\" file \"" << pi << '"');
try
{
unzipFile f(request.getArg("file"));
unzipFileStream in(f, pi, false);
// set Content-Type
std::string contentType = request.getArg("contenttype");
if (contentType.empty())
setContentType(request, reply);
else
reply.setContentType(contentType);
reply.out() << in.rdbuf();
}
catch (const unzipEndOfListOfFile&)
{
log_debug("file \"" << pi << "\" not found in archive");
return DECLINED;
}
return HTTP_OK;
}
开发者ID:DaTomTom,项目名称:tntnet,代码行数:31,代码来源:unzipcomp.cpp
示例9: setContentType
void IMM::load(istream &is)
{
int numModels, numElements;
BOOM::String str, pStr;
ContentType contentType;
is >> contentType >> N >> phase >> numModels;
setContentType(contentType);
for(int i=0 ; i<numModels ; ++i)
{
models->push_back(new BOOM::StringMap<double>(hashTableSize(N)));
BOOM::StringMap<double> &model=*(*models)[i];
is >> numElements;
for(int j=0 ; j<numElements ; ++j)
{
is >> str >> pStr;
model.lookup(str.c_str(),str.length())=pStr.asDouble();
}
}
if(getStrand()==FORWARD_STRAND)
{
BOOM::String modelType;
is >> modelType;
revComp=new IMM(is,REVERSE_STRAND);
revComp->revComp=this;
}
开发者ID:bmajoros,项目名称:EGGS,代码行数:28,代码来源:IMM.C
示例10: setContentType
void QxtMailAttachment::setExtraHeader(const QString& key, const QString& value)
{
if (key.compare(QStringLiteral("Content-Type"), Qt::CaseInsensitive) == 0)
setContentType(value);
else
qxt_d->extraHeaders[key.toLower()] = value;
}
开发者ID:Ri0n,项目名称:QtMail,代码行数:7,代码来源:mailattachment.cpp
示例11: ASSERT
Blob* XMLHttpRequest::responseBlob()
{
ASSERT(m_responseTypeCode == ResponseTypeBlob);
ASSERT(doneWithoutErrors());
if (!m_responseBlob) {
// FIXME: This causes two (or more) unnecessary copies of the data.
// Chromium stores blob data in the browser process, so we're pulling the data
// from the network only to copy it into the renderer to copy it back to the browser.
// Ideally we'd get the blob/file-handle from the ResourceResponse directly
// instead of copying the bytes. Embedders who store blob data in the
// same process as WebCore would at least to teach BlobData to take
// a SharedBuffer, even if they don't get the Blob from the network layer directly.
auto blobData = std::make_unique<BlobData>();
// If we errored out or got no data, we still return a blob, just an empty one.
size_t size = 0;
if (m_binaryResponseBuilder) {
RefPtr<RawData> rawData = RawData::create();
size = m_binaryResponseBuilder->size();
rawData->mutableData()->append(m_binaryResponseBuilder->data(), size);
blobData->appendData(rawData, 0, BlobDataItem::toEndOfFile);
String normalizedContentType = Blob::normalizedContentType(responseMIMEType());
blobData->setContentType(normalizedContentType); // responseMIMEType defaults to text/xml which may be incorrect.
m_binaryResponseBuilder.clear();
}
m_responseBlob = Blob::create(std::move(blobData), size);
}
return m_responseBlob.get();
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:30,代码来源:XMLHttpRequest.cpp
示例12: setCubicTextureName
//-----------------------------------------------------------------------
void TextureUnitState::setCubicTextureName( const String& name, bool forUVW)
{
if (forUVW)
{
setCubicTextureName(&name, forUVW);
}
else
{
setContentType(CONTENT_NAMED);
mTextureLoadFailed = false;
String ext;
String suffixes[6] = {"_fr", "_bk", "_lf", "_rt", "_up", "_dn"};
String baseName;
String fullNames[6];
size_t pos = name.find_last_of(".");
if( pos != String::npos )
{
baseName = name.substr(0, pos);
ext = name.substr(pos);
}
else
baseName = name;
for (int i = 0; i < 6; ++i)
{
fullNames[i] = baseName + suffixes[i] + ext;
}
setCubicTextureName(fullNames, forUVW);
}
}
开发者ID:Anti-Mage,项目名称:ogre,代码行数:33,代码来源:OgreTextureUnitState.cpp
示例13: connect
void ServerImpl::handleRegisterFiles(QHttpRequest *req, QHttpResponse *resp)
{
req->storeBody();
connect(req, &QHttpRequest::end, [this, req, resp]() {
QByteArray jsonTextBin = req->body();
QJsonObject json = QJsonDocument::fromJson(jsonTextBin).object();
QByteArray content("ok");
if (!json.isEmpty()) {
FileInfo fi;
fi.filename = json["filename"].toString();
fi.filepath = json["filepath"].toString();
fi.hash = json["md5"].toString();
fi.ttl = json["ttl"].toInt();
fi.registeredTime = QDateTime::currentDateTime();
if (!fi.filename.isEmpty() && !fi.hash.isEmpty() && QFile::exists(fi.filepath)) {
mRegisteredFiles[fi.hash] = fi;
}
}
resp->setHeader("Content-Length", QString::number(content.length()));
setContentType(resp, "text/plain");
resp->writeHead(200); // everything is OK
resp->write(content);
resp->end();
});
}
开发者ID:xae,项目名称:arm_gate,代码行数:27,代码来源:serverimpl.cpp
示例14: foreach
foreach (const QString &headerRow, headerLines) {
QRegExp messageIdRx("^Message-ID: (.*)$", Qt::CaseInsensitive);
QRegExp fromRx("^From: (.*)$", Qt::CaseInsensitive);
QRegExp toRx("^To: (.*)$", Qt::CaseInsensitive);
QRegExp ccRx("^Cc: (.*)$", Qt::CaseInsensitive);
QRegExp subjectRx("^Subject: (.*)$", Qt::CaseInsensitive);
QRegExp dateRx("^Date: (.*)$", Qt::CaseInsensitive);
QRegExp mimeVerstionRx("^MIME-Version: (.*)$", Qt::CaseInsensitive);
QRegExp contentTransferEncodingRx("^Content-Transfer-Encoding: (.*)$", Qt::CaseInsensitive);
QRegExp contentTypeRx("^Content-Type: (.*)$", Qt::CaseInsensitive);
if (messageIdRx.indexIn(headerRow) != -1)
setMessageId(messageIdRx.cap(1));
else if (fromRx.indexIn(headerRow) != -1)
setFrom(headerDecode(fromRx.cap(1)));
else if (toRx.indexIn(headerRow) != -1)
setTo(headerDecode(toRx.cap(1)));
else if (ccRx.indexIn(headerRow) != -1)
setCc(headerDecode(ccRx.cap(1)));
else if (subjectRx.indexIn(headerRow) != -1)
setSubject(headerDecode(subjectRx.cap(1)));
else if (dateRx.indexIn(headerRow) != -1) {
QDateTime date = QDateTime::fromString(dateRx.cap(1), Qt::RFC2822Date);
setDate(date);
} else if (mimeVerstionRx.indexIn(headerRow) != -1)
setMimeVersion(mimeVerstionRx.cap(1));
else if (contentTransferEncodingRx.indexIn(headerRow) != -1)
setContentTransferEncoding(IqPostmanAbstractContent::contentTransferEncodingFromString(headerRow));
else if (contentTypeRx.indexIn(headerRow) != -1)
setContentType(IqPostmanAbstractContentType::createFromString(headerRow));
}
开发者ID:ItQuasarOrg,项目名称:IqPostman,代码行数:31,代码来源:iqpostmanmailheader.cpp
示例15: setContentType
void body::setContents(ref <const contentHandler> contents, const mediaType& type,
const charset& chset, const encoding& enc)
{
m_contents = contents;
setContentType(type, chset);
setEncoding(enc);
}
开发者ID:kreinloo,项目名称:vmime,代码行数:8,代码来源:body.cpp
示例16: mediaType
void MailMessage::makeMultipart()
{
if (!isMultipart())
{
MediaType mediaType("multipart", "mixed");
setContentType(mediaType);
}
}
开发者ID:1514louluo,项目名称:poco,代码行数:8,代码来源:MailMessage.cpp
示例17: setStatusCode
void HttpResponse::setHttp501Status() {
setStatusCode(HTTP_METHODERROR);
setContentType(CONTEXT_TYPE_HTML);
addHeader("Server", JOINTCOM_FLAG);
setBody("<HTML><TITLE>Method Not FOUND</TITLE>\r\n"
"<BODY><P>(CODE: 501)</P>\r\n"
"HTTP request method not supported.\r\n"
"</BODY></HTML>\r\n");
}
开发者ID:SanHot,项目名称:snet,代码行数:9,代码来源:HttpResponse.cpp
示例18: setContentType
ThreePeriodicMarkovChain::ThreePeriodicMarkovChain(BOOM::Vector<TrainingSequence*> &
sequences,int order,
int minSampleSize,
ContentType contentType)
{
setContentType(contentType);
setStrand(PLUS_STRAND);
buildModels(sequences,minSampleSize,order);
}
开发者ID:ReddyLab,项目名称:FBI,代码行数:9,代码来源:ThreePeriodicMarkovChain.C
示例19: setStatus
void HttpResponse::redirect(QString location, int status) {
if (!d)
return;
setStatus(status);
setHeader(QStringLiteral("Location"), location);
setContentType(QStringLiteral("text/html;charset=UTF-8"));
// LATER url encode
output()->write(QStringLiteral(
"<html><body>Moved. Please click on <a href=\"%1"
"\">this link</a>").arg(location).toUtf8().constData());
}
开发者ID:g76r,项目名称:libqtssu,代码行数:11,代码来源:httpresponse.cpp
示例20: QObject
/*!
\~english
\brief Constructor.
\~japanese
\brief コンストラクタ
*/
TActionController::TActionController()
: QObject(),
TAbstractController(),
statCode(200),
rendered(false),
layoutEnable(true),
rollback(false)
{
// Default content type
setContentType("text/html");
}
开发者ID:deniskin82,项目名称:treefrog-framework,代码行数:18,代码来源:tactioncontroller.cpp
注:本文中的setContentType函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论