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

C++ eString类代码示例

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

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



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

示例1: eDebug

eString eMountPoint::tryCifsMount(const eString& cmd, int linuxExt)
{
	eString rc;
	
	if(linuxExt == 0)
	{
		// If we don't want linux extensions on cifs, disable it first
		eDebug("[MOUNT] disabling linux extensions");
		eString procCommand = "echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled";
		system(procCommand.c_str());
	}
						
	// Execute the mount command
	eDebug("[MOUNT] mounting: %s", cmd.c_str());
	if(system(cmd.c_str()) != 0)
	{
		rc = _("Mount failed");
	}

	if(linuxExt == 0)
	{
		// Enable linux extensions afterwards
		eDebug("[MOUNT] enabling linux extensions");
		eString procCommand = "echo 1 > /proc/fs/cifs/LinuxExtensionsEnabled";
		system(procCommand.c_str());
	}
	
	return rc;
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:29,代码来源:enigma_mount.cpp


示例2: getRequestOptions

std::map<eString, eString> getRequestOptions(eString opt, char delimiter)
{
	std::map<eString, eString> result;

	if (opt[0] == '?')
		opt = opt.mid(1);

	while (opt.length())
	{
		unsigned int e = opt.find("=");
		if (e == eString::npos)
			e = opt.length();
		unsigned int a = opt.find(delimiter, e);
		if (a == eString::npos)
			a = opt.length();
		eString n = opt.left(e);

		unsigned int b = opt.find(delimiter, e + 1);
		if (b == eString::npos)
			b = (unsigned)-1;
		eString r = httpUnescape(opt.mid(e + 1, b - e - 1));
		result.insert(std::pair<eString, eString>(n, r));
		opt = opt.mid(a + 1);
	}
	return result;
}
开发者ID:UkCvs,项目名称:commando,代码行数:26,代码来源:enigma_dyn_utils.cpp


示例3: readFile

eString readFile(eString filename)
{
	eString result;
	eString line;
	
	if (strstr(filename.c_str(), (TEMPLATE_DIR).c_str()) != 0)
	{
		const char *pch = strrchr(filename.c_str(), '/');
		eString filename2 = TEMPLATE_DIR2 + eString(strdup(pch + 1));
		if (access(filename2.c_str(), R_OK) == 0)
			filename = filename2;
	}	
			
	if (strstr(filename.c_str(), (HTDOCS_DIR).c_str()) != 0)
	{
		const char *pch = strrchr(filename.c_str(), '/');
		eString filename2 = HTDOCS_DIR2 + eString(strdup(pch + 1));
		if (access(filename2.c_str(), R_OK) == 0)
			filename = filename2;
	}

	ifstream infile(filename.c_str());
	if (infile)
		while (getline(infile, line, '\n'))
			result += line + "\n";

	return result;
}
开发者ID:UkCvs,项目名称:commando,代码行数:28,代码来源:enigma_dyn_utils.cpp


示例4: httpUnescape

eString httpUnescape(const eString &string)
{
	eString result;
	for (unsigned int i = 0; i < string.length(); ++i)
	{
		int c = string[i];
		switch (c)
		{
		case '%':
		{
			int value = '%';
			if ((i + 1) < string.length())
				value = getHex(string[++i]);
			if ((i + 1) < string.length())
			{
				value <<= 4;
				value += getHex(string[++i]);
			}
			result += value;
			break;
		}
		case '+':
			result += ' ';
			break;
		default:
			result += c;
			break;
		}
	}
	return result;
}
开发者ID:UkCvs,项目名称:commando,代码行数:31,代码来源:enigma_dyn_utils.cpp


示例5: filter_string

eString filter_string(eString string)
{
	string.strReplace("\xc2\x86","");
	string.strReplace("\xc2\x87","");
	string.strReplace("\xc2\x8a"," ");
	string.strReplace("\"", "'");
	return string;
}
开发者ID:UkCvs,项目名称:commando,代码行数:8,代码来源:enigma_dyn_utils.cpp


示例6: updateNameIdPair

void FileMap::updateNameIdPair(const eString& chanId, const eString& name)
{
    if (chanId.length() > 0 && name.length() > 0)
    {
        channelId2Names[chanId] = name;
        channelName2Id[name] = chanId;
    }

}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:9,代码来源:filemap.cpp


示例7: updatePPPConfig

static void updatePPPConfig( const eString &secrets, int flags )
{
	char sourceA[8192];  // source buffer
	char destA[8192]; // dest buffer
	char *source = sourceA;
	char *dest = destA;

	FILE *f = fopen("/etc/ppp/pppoe.conf", "r" );
	if ( !f )
	{
		eDebug("couldn't open '/etc/ppp/pppoe.conf' for read");
		return;
	}
	size_t readed = fread(source, 1, sizeof(sourceA), f );
	if ( !readed )
	{
		eDebug("couldn't read '/etc/ppp/pppoe.conf'");
		return;
	}

	uint spos = 0;
	uint dpos = 0;
	uint ppos = secrets.find('*');

	if ( ppos != eString::npos )
	{
		eString strUser = '\'' + secrets.left(ppos) + "\'\n";
		helper( source, dest, spos, dpos, "USER=", strUser.c_str() );
	}
	int webifport=80;
	eConfig::getInstance()->getKey("/elitedvb/network/webifport", webifport);
	eString s;
	s.sprintf("%d\n", webifport);
	helper( source, dest, spos, dpos, "ENIGMA_WEB_IF_PORT=", s.c_str() );
	helper( source, dest, spos, dpos, "REJECT_WWW=", flags&1?"yes\n":"no\n" );
	helper( source, dest, spos, dpos, "REJECT_TELNET=", flags&2?"yes\n":"no\n" );
	helper( source, dest, spos, dpos, "REJECT_SAMBA=", flags&4?"yes\n":"no\n" );
	helper( source, dest, spos, dpos, "REJECT_FTP=", flags&8?"yes\n":"no\n" );

	memcpy( dest+dpos, source+spos, readed - spos );
	dpos += readed-spos;

	fclose(f);
	f = fopen("/etc/ppp/pppoe.conf", "w");
	if ( !f )
	{
		eDebug("couldn't open '/etc/ppp/pppoe.conf' for write");
		return;
	}
	unsigned int written;
	if ( (written = fwrite( dest, 1, dpos, f )) != dpos )
		eDebug("couldn't write correct count of bytes...\n%d bytes written %d should be written", written, dpos );
	fclose(f);
}
开发者ID:OpenDMM,项目名称:tuxbox-apps,代码行数:54,代码来源:setupnetwork.cpp


示例8: icompare

/////////////////////////////////////// eString icompare(const  eString&) /////////////////////
int eString::icompare(const eString& s)
{
//	makes a case insensitive string compare
	std::string::const_iterator p = begin(), p2 = s.begin();

	while ( p != end() && p2 != s.end() )
		if ( tolower(*p) != tolower(*p2) )
			return tolower(*p) < tolower(*p2) ? -1 : 1;
		else
			p++, p2++;

	return length() == s.length() ? 0 : length() < s.length() ? -1 : 1;
}
开发者ID:aOpenPLi,项目名称:epgen,代码行数:14,代码来源:estring.cpp


示例9: remoteType

int remoteType( eString spec )
{
	if ( spec.length() == 0 )
		return inputDefRemoteTypeNone;
	else {
		eString prot = spec.left(5);
		if ( prot == "http:" )
			return inputDefRemoteTypeHTTP;
		else if ( prot == "otid:" ) 
			return inputDefRemoteTypeOTV;
		else
			return inputDefRemoteTypeNone;
	}
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:14,代码来源:inputdefreader.cpp


示例10: s

		// we got (http) metadata.
void eMP3Decoder::metaDataUpdated(eString meta)
{
	{
		singleLock s(lock);  // must protect access on metadata array
		eString streamTitle, streamUrl;
		if (meta.left(6) == "Stream")
			while (!meta.empty())
			{
				unsigned int eq=meta.find('=');
				if (eq == eString::npos)
						break;
				eString left=meta.left(eq);
				meta=meta.mid(eq+1); // skip until =
				eq=meta.find(';');
				if (eq == eString::npos)
					break;
				eString right=meta.left(eq);
				meta=meta.mid(eq+1);
				if (left=="StreamTitle")
					streamTitle=right;
				else if (left == "StreamUrl")
					streamUrl=right;
				else
					eDebug("unknown tag: %s = %s", left.c_str(), right.c_str());			
			}
		else
			streamTitle=meta;

		metadata[0]=streamTitle;
		metadata[1]=streamUrl;
	}

	handler->messages.send(eServiceHandlerMP3::eMP3DecoderMessage(eServiceHandlerMP3::eMP3DecoderMessage::infoUpdated));
}
开发者ID:TitanNit,项目名称:tdt,代码行数:35,代码来源:servicemp3.cpp


示例11: wapEPGDetails

static eString wapEPGDetails(eString serviceRef, eString eventID)
{
	eString result;
	eService *current = NULL;
	eString ext_description;
	std::stringstream record;
	int eventid;
	eString description = "No description available";

	sscanf(eventID.c_str(), "%x", &eventid);
	eDebug("[ENIGMA_DYN] getEPGDetails: serviceRef = %s, ID = %04x", serviceRef.c_str(), eventid);

	// search for the event... to get the description...
	eDVBServiceController *sapi=eDVB::getInstance()->getServiceAPI();
	if (sapi)
	{
		eServiceReference ref(string2ref(serviceRef));
		current = eDVB::getInstance()->settings->getTransponders()->searchService((eServiceReferenceDVB&)ref);
		if (current)
		{
			EITEvent *event = eEPGCache::getInstance()->lookupEvent((eServiceReferenceDVB&)ref, eventid);
			if (event)
			{
				LocalEventData led;
				led.getLocalData(event, &description, &ext_description);
				ext_description.strReplace("\n", "<br/>");
				if (!ext_description)
					ext_description = "No detailed information available";
#ifndef DISABLE_FILE
				record << "<a href=\"/wap?mode=addTimerEvent"
					<< ",path=" << ref2string(ref)
					<< ",ID=" << std::hex << event->event_id << std::dec
					<< ",start=" << event->start_time
					<< ",duration=" << event->duration
					<< ",descr=" << filter_string(description)
					<< ",channel=" << filter_string(current->service_name)
					<< "\">Record</a>";
#endif
				delete event;
			}
		}
	}

	result = readFile(TEMPLATE_DIR + "wapEPGDetails.tmp");
	result.strReplace("#EVENT#", filter_string(description));
	result.strReplace("#RECORD#", record.str());
	result.strReplace("#BODY#", filter_string(ext_description));

	return result;
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:50,代码来源:enigma_dyn_wap.cpp


示例12: addDirectory

void eServiceHandlerExternal::addDirectory(void *node, const eString &filename)
{
	for (unsigned int i = 0; i < extensionDirectoryList.size(); i++)
	{
		int matchsize = extensionDirectoryList[i].pattern.length();
		if (filename.right(matchsize).upper() == extensionDirectoryList[i].pattern.upper())
		{
			eServiceReference ref(id, 0, filename);
			ref.descr = _("Start player");
			eServiceFileHandler::getInstance()->addReference(node, ref);
			eDebug("Add directory: %s", filename.c_str());
			return;
		}
	}
}
开发者ID:ChakaZulu,项目名称:my_tuxbox_apps,代码行数:15,代码来源:serviceexternal.cpp


示例13: connectToHost

int eSocket::connectToHost(eString hostname, int port)
{
	sockaddr_in  serv_addr;
	struct hostent *server;
	int res;

	if (mystate == Invalid)
	{
		/* the socket has been closed, create a new socket descriptor */
		int s=socket(AF_INET, SOCK_STREAM, 0);
		mystate=Idle;
		setSocket(s, 1, mainloop);
	}
	
	if(socketdesc < 0){
		error_(errno);
		return(-1);
	}
	server=gethostbyname(hostname.c_str());
	if(server==NULL)
	{
		eDebug("can't resolve %s", hostname.c_str());
		error_(errno);
		return(-2);
	}
	memset(&serv_addr, 0, sizeof(serv_addr));
	serv_addr.sin_family=AF_INET;
	memmove(&serv_addr.sin_addr.s_addr, server->h_addr, server->h_length);
	serv_addr.sin_port=htons(port);
	res=::connect(socketdesc, (const sockaddr*)&serv_addr, sizeof(serv_addr));
	if ((res < 0) && (errno != EINPROGRESS) && (errno != EINTR))
	{
		eDebug("can't connect to host: %s", hostname.c_str());
		close();
		error_(errno);
		return(-3);
	}
	if (res < 0)	// EINPROGRESS or EINTR
	{
		rsn->setRequested(rsn->getRequested()|eSocketNotifier::Write);
		mystate=Connecting;
	} else
	{
		mystate=Connection;
		connected_();
	}
	return(0);
}
开发者ID:ChakaZulu,项目名称:tuxbox_apps,代码行数:48,代码来源:socket.cpp


示例14: getVideoParms

struct videoTypeParms eMPConfig::getVideoParms(eString name, eString extension)
{
	struct videoTypeParms vparms;
	
	extension = extension.upper();
	
//	eDebug("[MPCONFIG] name = %s, extension = %s", name.c_str(), extension.c_str());
	
	vparms.name = "default";
	vparms.extension = extension;
	vparms.videoRate = "1024";
	vparms.audioRate = "192";
	vparms.videoCodec = "mpeg2";
	vparms.videoRatio = "704x576";
	vparms.transcodeVideo = false;
	vparms.transcodeAudio = false;
	vparms.fps = "25";
	vparms.soutadd = false;

	for ( unsigned int i = 0; i < videoParmList.size(); i++)
	{
		if ((videoParmList[i].extension == extension) && (videoParmList[i].name == name))
		{
			vparms = videoParmList[i];
			break;
		}
	}
//	eDebug("[MPCONFIG] vparms.extension: %s",vparms.extension.c_str());
	return vparms;
}
开发者ID:nx111,项目名称:OpenPLi-1,代码行数:30,代码来源:mpconfig.cpp


示例15: EPGSearching

int eEPGSearch::EPGSearching(eString title, int ExactMatch, int CaseSensitive, int TimeSpanSearch, tm beginTime, tm endTime, int Days, int Max_Duration )
{
	eString search;
	eString current;
	int intFound = 0;
	search = title;

	
	if (!ExactMatch && !CaseSensitive)
		search = title.upper();

	SearchResultsEPG.clear();
	current = "1:15:fffffffe:12:ffffffff:0:0:0:0:0:";
	eServiceInterface *iface=eServiceInterface::getInstance();
	if (iface)
	{		
		if (search != "")
		{
			eServiceReference current_service=string2ref(current);
			eSearchAllTVServices2 conv( *iface, search,ExactMatch, CaseSensitive, TimeSpanSearch, beginTime, endTime, Days, Max_Duration);
			Signal1<void,const eServiceReference&> signal;
			signal.connect(slot(conv, &eSearchAllTVServices2::addEntry));
			iface->enterDirectory(current_service, signal);
			iface->leaveDirectory(current_service);
		}
	}
	if (SearchResultsEPG.size() )
		intFound = 1;
	return intFound;
}
开发者ID:ChakaZulu,项目名称:my_tuxbox_apps,代码行数:30,代码来源:epgsearch.cpp


示例16: _clear

void eAllowedOpInput::parseConfig(const eString &config)
{
    _clear();

    const eU32 configLen = config.length();
    eString buffer;

    for (eU32 i=0; i<configLen; i++)
    {
        buffer = "";

        while (i < configLen && config[i] != '|')
        {
            buffer += config[i++];
        }

        eString left, right;

        if (!buffer.split(',', left, right))
        {
            eSwap(left, right);
        }

        WhereWhat *ww = new WhereWhat;
        eASSERT(ww != eNULL);
        ww->index = (left == "" ? -1 : eStrToInt(left));
        ww->what = right;

        m_allowed.append(ww);
        m_allAllowed.append(new eString(right));
    }
}
开发者ID:DX94,项目名称:Enigma-Studio-3,代码行数:32,代码来源:opinput.cpp


示例17: setProperty

int eListBoxBase::setProperty(const eString &prop, const eString &value)
{
	if (prop == "noPageMovement")
	{
		if (value == "off")
			flags &= ~flagNoPageMovement;
		else
			flags |= flagNoPageMovement;
	}
	else if (prop == "noUpDownMovement")
	{
		if (value == "off")
			flags &= ~flagNoUpDownMovement;
		else
			flags |= flagNoUpDownMovement;
	}
	else if (prop=="activeForegroundColor")
		colorActiveF=eSkin::getActive()->queryScheme(value);
	else if (prop=="activeBackgroundColor")
		colorActiveB=eSkin::getActive()->queryScheme(value);
	else if (prop=="showEntryHelp")
		setFlags( flagShowEntryHelp );
	else if (prop=="columns")
		setColumns( value?atoi(value.c_str()):1 );
	else
		return eDecoWidget::setProperty(prop, value);

	return 0;
}
开发者ID:nx111,项目名称:OpenPLi-1,代码行数:29,代码来源:listbox.cpp


示例18: tcpOpen

int tcpOpen(eString serverIP, int serverPort, int i)
{
	struct sockaddr_in ads;
	socklen_t adsLen;
	int fd = -1;
	int rc = -1;
	int retry = 0;

	memset((char *)&ads, 0, sizeof(ads));
	ads.sin_family = AF_INET;
	ads.sin_addr.s_addr = inet_addr(serverIP.c_str());
	ads.sin_port = htons(serverPort);
	adsLen = sizeof(ads);

	if ((fd = socket(AF_INET, SOCK_STREAM, 0)) != -1)
	{
		fcntl(fd, F_SETFL, O_NONBLOCK);
		retry = 100 * i;
		while (retry-- > 0 && rc < 0)
		{
			if ((rc = connect(fd, (struct sockaddr *)&ads, adsLen)) < 0)
				usleep(10000); // 10 milliseconds
		}
		if (rc < 0)
		{
			close(fd);
			fd = -1;
		}
	}
	eDebug("[MOVIEPLAYER] tcpOpen: socket fd = %d, waited %d milliseconds", fd, (100 * i - retry) * 10);

	return fd;
}
开发者ID:UkCvs,项目名称:commando,代码行数:33,代码来源:utils.cpp


示例19: switch

bool eMountPoint::isIdentical(eString mountOn, eString mountDev)
{
	bool found = false;
	
	if ((mountOn == localDir) || (mountOn.strReplace("/media/", "/mnt/") == localDir))
	{
		switch (fstype)
		{
			case nfsMount:
				found =	(eString().sprintf("%s:%s", remoteHost.c_str(), mountDir.c_str()) == mountDev);
				if (!found)
					found =	(eString().sprintf("%s:/%s", remoteHost.c_str(), mountDir.c_str()) == mountDev);
				break;
			case cifsMount:
				found =	(eString().sprintf("//%s/%s", remoteHost.c_str(), mountDir.c_str()) == mountDev);
				if (!found)
					found =	(eString().sprintf("//%s/%s", remoteIP.c_str(), mountDir.c_str()) == mountDev);
				break;
			case smbMount:
				found =	(eString().sprintf("//%s/%s", remoteHost.upper().c_str(), mountDir.upper().c_str()) == mountDev.upper());
				if (!found)
					found =	(eString().sprintf("//%s/%s", remoteIP.c_str(), mountDir.upper().c_str()) == mountDev.upper());
				break;
	#ifdef ENABLE_DEVMOUNTS
			case deviceMount:
				found = ((mountOn == localDir) && (mountDev == mountDir) && remoteHost == (eString) "");
				break;
	#endif
			default:
				break;
		}
	}

	return found;
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:35,代码来源:enigma_mount.cpp


示例20: drawEntryRect

const eString& eListBoxEntryTransponder::redraw(gPainter *rc, const eRect& rect, gColor coActiveB, gColor coActiveF, gColor coNormalB, gColor coNormalF, int state)
{
    bool b = (state == 2);

    drawEntryRect( rc, rect, coActiveB, coActiveF, coNormalB, coNormalF, b?0:state );

    static eString text;
    text.sprintf("%d / %d / %c", tp->satellite.frequency/1000, tp->satellite.symbol_rate/1000, tp->satellite.polarisation?'V':'H' );
    rc->setFont(font);
    rc->renderText( rect, text );

    if ( b )
        drawEntryBorder( rc, rect, coActiveB, coActiveF, coNormalB, coNormalF );

    return text;
}
开发者ID:backtrack2016,项目名称:tdt,代码行数:16,代码来源:tpeditwindow.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ eWindowStyle类代码示例发布时间:2022-05-31
下一篇:
C++ eRect类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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