• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setEncoding函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ensureEncodingSet

static int
ensureEncodingSet()
{
    if (!_encodingSet) {
	setEncoding(getenv("LC_ALL"));

	if (!_encodingSet) {
	    setEncoding(getenv("LC_CTYPE"));

	    if (!_encodingSet) {
		setEncoding(getenv("LANG"));

		if (!_encodingSet) {
		    errMsg("Character encoding not specified and not settable "
                        "from environment variables LC_ALL, LC_CTYPE, or LANG. "
                        "Assuming ASCII encoding.");

		    setEncoding("ASCII");
		}
	    }
	}
    }

    if (_encodingSet)
	_formattingOptions |= _encoding;

    return _encodingSet;
}
开发者ID:Unidata,项目名称:UDUNITS-2,代码行数:28,代码来源:udunits2.c


示例2: setEncoding

bool HuffmanTree::setEncoding(BST<CharFreq>::BSTNode *nodePtr, string encode)
{
  if(nodePtr == nullptr)
	return false;
  else
	{

	  if(nodePtr->left == nullptr && nodePtr->right == nullptr)
		nodePtr->data.encoding = encode;
	  
	  if(nodePtr->left)
		{
		  encode += "0";
		  setEncoding(nodePtr->left, encode);
		  encode.pop_back();
		}
	  if(nodePtr->right)
		{
		  encode += "1";
		  setEncoding(nodePtr->right, encode);
		  encode.pop_back();
		}

	  return true;
	}
  return false;
}
开发者ID:scienceguy12,项目名称:P5,代码行数:27,代码来源:HuffmanTree.cpp


示例3: base

ofdocstream::ofdocstream(const char* s, ios_base::openmode mode,
			 string const & encoding)
	: base()
{
	setEncoding(*this, encoding, out);
	open(s, mode);
}
开发者ID:cburschka,项目名称:lyx,代码行数:7,代码来源:docstream.cpp


示例4: kdDebug

void
KSpellConfig::sChangeEncoding( int i )
{
  kdDebug(750) << "KSpellConfig::sChangeEncoding(" << i << ")" << endl;
  setEncoding( i );
  emit configChanged();
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:7,代码来源:ksconfig.cpp


示例5: getPCMInformation

void getPCMInformation(int indentLevel, int portNumber) {
    /* assert: PCM is a supported mode */
    OMX_AUDIO_PARAM_PCMMODETYPE sPCMMode;

    /* set it into PCM format before asking for PCM info */
    if (setEncoding(portNumber, OMX_AUDIO_CodingPCM) != OMX_ErrorNone) {
	fprintf(stderr, "Error in setting coding to PCM\n");
	return;
    }
       
    setHeader(&sPCMMode, sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
    sPCMMode.nPortIndex = portNumber;
    err = OMX_GetParameter(handle, OMX_IndexParamAudioPcm, &sPCMMode);
    if(err != OMX_ErrorNone){
	indent printf("PCM mode unsupported\n");
    } else {
	indent printf("  PCM default sampling rate %d\n", sPCMMode.nSamplingRate);
	indent printf("  PCM default bits per sample %d\n", sPCMMode.nBitPerSample);
	indent printf("  PCM default number of channels %d\n", sPCMMode.nChannels);
    }      

    /*
    setHeader(&sAudioPortFormat, sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE));
    sAudioPortFormat.nIndex = 0;
    sAudioPortFormat.nPortIndex = portNumber;
    */

    
}
开发者ID:wyongfei,项目名称:LinuxSound-HTMLSource,代码行数:29,代码来源:info.c


示例6: InputSource

// $$$ ToDo:  Xerces' InputSource class does not yet have a copy
// constructor or assignment operator.  See bug #7944.
XSLTInputSource::XSLTInputSource(
            const XSLTInputSource&  theSource,
            MemoryManager&          theMemoryManager) :
    InputSource(&theMemoryManager),
    m_stream(theSource.m_stream),
    m_node(theSource.m_node)
{
    setIssueFatalErrorIfNotFound(theSource.getIssueFatalErrorIfNotFound());

    const XMLCh*    theValue = theSource.getSystemId();

    if (theValue != 0)
    {
        setSystemId(theValue);
    }

    theValue = theSource.getPublicId();

    if (theValue != 0)
    {
        setPublicId(theValue);
    }

    theValue = theSource.getEncoding();

    if (theValue != 0)
    {
        setEncoding(theValue);
    }
}
开发者ID:apache,项目名称:xalan-c,代码行数:32,代码来源:XSLTInputSource.cpp


示例7: QDialog

ImportCsvDialog::ImportCsvDialog(const QString& filename, DBBrowserDB* db, QWidget* parent)
    : QDialog(parent),
      ui(new Ui::ImportCsvDialog),
      csvFilename(filename),
      pdb(db)
{
    ui->setupUi(this);

    // Get the actual file name out of the provided path and use it as the default table name for import
    QFileInfo file(filename);
    ui->editName->setText(file.baseName());

    // Create a list of all available encodings and create an auto completion list from them
    QStringList encodingList;
    foreach(QString enc, QTextCodec::availableCodecs())
        encodingList.push_back(enc);
    encodingCompleter = new QCompleter(encodingList, this);
    encodingCompleter->setCaseSensitivity(Qt::CaseInsensitive);
    ui->editCustomEncoding->setCompleter(encodingCompleter);

    // Load last used settings and apply them
    QSettings settings(QApplication::organizationName(), QApplication::organizationName());
    ui->checkboxHeader->setChecked(settings.value("importcsv/firstrowheader", false).toBool());
    ui->checkBoxTrimFields->setChecked(settings.value("importcsv/trimfields", true).toBool());
    setSeparatorChar(QChar(settings.value("importcsv/separator", ',').toInt()));
    setQuoteChar(QChar(settings.value("importcsv/quotecharacter", '"').toInt()));
    setEncoding(settings.value("importcsv/encoding", "UTF-8").toString());

    // Initialise user interface
    checkInput();
    updatePreview();
}
开发者ID:GeorgijK,项目名称:sqlitebrowser,代码行数:32,代码来源:ImportCsvDialog.cpp


示例8: QDialog

ImportCsvDialog::ImportCsvDialog(const QString& filename, DBBrowserDB* db, QWidget* parent)
    : QDialog(parent),
      ui(new Ui::ImportCsvDialog),
      csvFilename(filename),
      pdb(db)
{
    ui->setupUi(this);

    QStringList encodingList;
    foreach(QString enc, QTextCodec::availableCodecs())
        encodingList.push_back(enc);
    encodingCompleter = new QCompleter(encodingList, this);
    encodingCompleter->setCaseSensitivity(Qt::CaseInsensitive);
    ui->editCustomEncoding->setCompleter(encodingCompleter);

    QSettings settings(QApplication::organizationName(), QApplication::organizationName());
    ui->checkboxHeader->setChecked(settings.value("importcsv/firstrowheader", false).toBool());
    ui->checkBoxTrimFields->setChecked(settings.value("importcsv/trimfields", true).toBool());
    setSeparatorChar(QChar(settings.value("importcsv/separator", 44).toInt()));
    setQuoteChar(QChar(settings.value("importcsv/quotecharacter", 34).toInt()));
    setEncoding(settings.value("importcsv/encoding", "UTF-8").toString());

    checkInput();
    updatePreview();
}
开发者ID:0077cc,项目名称:sqlitebrowser,代码行数:25,代码来源:ImportCsvDialog.cpp


示例9: setSyncModes

void MailSyncSourceConfig::assign(const MailSyncSourceConfig& sc) {
    setName     (sc.getName     ());
    setURI      (sc.getURI      ());
    setSyncModes(sc.getSyncModes());
    setType     (sc.getType     ());
    setSync     (sc.getSync     ());
    setLast     (sc.getLast     ());

    setEncoding      (sc.getEncoding      ());
    setVersion       (sc.getVersion       ());
    setSupportedTypes(sc.getSupportedTypes());
    //setCtCap         (sc.getCtCap         ());
    setEncryption    (sc.getEncryption    ());

    setDownloadAge(sc.getDownloadAge());
    setBodySize(sc.getBodySize());
    setAttachSize(sc.getAttachSize());

    setInbox(sc.getInbox());
    setOutbox(sc.getOutbox());
    setSent(sc.getSent());
    setTrash(sc.getTrash());
    setDraft(sc.getDraft());
    setSchedule(sc.getSchedule());
    mailAccounts = sc.getMailAccounts();
}
开发者ID:pohly,项目名称:funambol-cpp-client-api,代码行数:26,代码来源:MailSyncSourceConfig.cpp


示例10: setIssueFatalErrorIfNotFound

XSLTInputSource&
XSLTInputSource::operator=(const XSLTInputSource&   theRHS)
{
    if (this != &theRHS)
    {
        m_stream = theRHS.m_stream;
        m_node = theRHS.m_node;

        setIssueFatalErrorIfNotFound(theRHS.getIssueFatalErrorIfNotFound());

        const XMLCh*    theValue = theRHS.getSystemId();

        if (theValue != 0)
        {
            setSystemId(theValue);
        }

        theValue = theRHS.getPublicId();

        if (theValue != 0)
        {
            setPublicId(theValue);
        }

        theValue = theRHS.getEncoding();

        if (theValue != 0)
        {
            setEncoding(theValue);
        }

    }

    return *this;
}
开发者ID:apache,项目名称:xalan-c,代码行数:35,代码来源:XSLTInputSource.cpp


示例11: QgsDataProvider

QgsVectorDataProvider::QgsVectorDataProvider( const QString& uri )
    : QgsDataProvider( uri )
    , mCacheMinMaxDirty( true )
{
  QSettings settings;
  setEncoding( settings.value( QStringLiteral( "/UI/encoding" ), "System" ).toString() );
}
开发者ID:3liz,项目名称:Quantum-GIS,代码行数:7,代码来源:qgsvectordataprovider.cpp


示例12: m_styleSheet

XmlDocument::XmlDocument( const std::string &encoding,
						 const std::string &styleSheet )
						 : m_styleSheet( styleSheet )
						 , m_rootElement( new XmlElement( "DummyRoot" ) )
						 , m_standalone( true )
{
	setEncoding( encoding );
}
开发者ID:qixianbd,项目名称:partition_wqm,代码行数:8,代码来源:XmlDocument.cpp


示例13: setResponse

void CachedResource::responseReceived(const ResourceResponse& response)
{
    setResponse(response);
    m_responseTimestamp = currentTime();
    String encoding = response.textEncodingName();
    if (!encoding.isNull())
        setEncoding(encoding);
}
开发者ID:CannedFish,项目名称:webkit,代码行数:8,代码来源:CachedResource.cpp


示例14: QgsDataProvider

QgsVectorDataProvider::QgsVectorDataProvider( QString uri )
    : QgsDataProvider( uri )
    , mCacheMinMaxDirty( true )
    , mFetchFeaturesWithoutGeom( true )
{
  QSettings settings;
  setEncoding( settings.value( "/UI/encoding", QString( "System" ) ).toString() );
}
开发者ID:aaronr,项目名称:Quantum-GIS,代码行数:8,代码来源:qgsvectordataprovider.cpp


示例15: QgsDataProvider

QgsVectorDataProvider::QgsVectorDataProvider( const QString& uri )
    : QgsDataProvider( uri )
    , mCacheMinMaxDirty( true )
    , mAttrPalIndexName( QgsAttrPalIndexNameHash() )
{
  QSettings settings;
  setEncoding( settings.value( "/UI/encoding", "System" ).toString() );
}
开发者ID:LZS1991,项目名称:SWGIS,代码行数:8,代码来源:qgsvectordataprovider.cpp


示例16: 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


示例17: setLevel

void JConsoleHandler::configure() {
    //TODO JLogManager* manager = JLogManager::getLogManager();
    //TODO JString cname = getClass()->getName();

    setLevel(JLevel::INFO);//TODO manager.getLevelProperty(cname +".level", Level.INFO));
    setFilter(NULL);//TODO manager.getFilterProperty(cname +".filter", null));
    setFormatter(new JSimpleFormatter());//TODO manager.getFormatterProperty(cname +".formatter", new SimpleFormatter()));
    try {
        setEncoding("");//TODO manager.getStringProperty(cname +".encoding", null));
    } catch (JException* ex) {
        delete ex;
        try {
            setEncoding("");
        } catch (JException* ex2) {
            delete ex2;
        }
    }
}
开发者ID:jeffedlund,项目名称:rpc,代码行数:18,代码来源:JConsoleHandler.cpp


示例18: QAbstractTableModel

ContentSelectorModel::ContentModel::ContentModel(QObject *parent) :
    QAbstractTableModel(parent),
    mMimeType ("application/omwcontent"),
    mMimeTypes (QStringList() << mMimeType),
    mColumnCount (1),
    mDragDropFlags (Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled),
    mDropActions (Qt::CopyAction | Qt::MoveAction)
{
    setEncoding ("win1252");
    uncheckAll();
}
开发者ID:Bodillium,项目名称:openmw,代码行数:11,代码来源:contentmodel.cpp


示例19: getClass

            void JSocketHandler::configure() {
                //TODO JLogManager* manager = JLogManager::getLogManager();
                JString cname = getClass()->getName();

                setLevel(JLevel::ALL);//TODO manager.getLevelProperty(cname +".level", Level.ALL));
                setFilter(NULL);//TODO manager.getFilterProperty(cname +".filter", null));
                setFormatter(new JXMLFormatter());//TODO manager.getFormatterProperty(cname +".formatter", new XMLFormatter()));
                try {
                    setEncoding("");//TODOmanager.getStringProperty(cname +".encoding", null));
                } catch (JException* ex) {
                    delete ex;
                    try {
                        setEncoding("");
                    } catch (JException* ex2) {
                        delete ex2;
                    }
                }
                port = 0;//TODO manager.getIntProperty(cname + ".port", 0);
                host = new JString("localhost");//TODO manager.getStringProperty(cname + ".host", null);
            }
开发者ID:jeffedlund,项目名称:rpc,代码行数:20,代码来源:JSocketHandler.cpp


示例20: handleHead

void handleHead() {
    setProjection(getCoordinateSystem());
    
    long lines = getSOSILinesLength();
    for (int i = 0; i < lines; i++) {
        char* line = getSOSILine(i);
        if (line != NULL && strncmp(line, "..TEGNSETT ", 11) == 0) {
            setEncoding(line+11);
        }
    }
}
开发者ID:Gnonthgol,项目名称:sosi2osm,代码行数:11,代码来源:sosi2osm.cpp



注:本文中的setEncoding函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setEncryptionStatus函数代码示例发布时间:2022-05-30
下一篇:
C++ setEncodedSize函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap