当前位置: 首页>>代码示例>>C++>>正文


C++ Strings::end方法代码示例

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


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

示例1: strip

	String String::strip(Strings tokens) const
	{
		if(tokens.empty())
			tokens.push_back(L" ");

		IndexVar left = 0, right = mContent.size();
		while(left<mContent.size())
		{
			bool flag = false;
			for(Strings::iterator ptr = tokens.begin(); ptr != tokens.end(); ptr++)
				if(find(*ptr,left)==left)
				{
					flag = true;
					break;
				}
			if(!flag)
				break;
			left++;
		}
		while(right>=0)
		{
			bool flag = false;
			for(Strings::iterator ptr = tokens.begin(); ptr != tokens.end(); ptr++)
				if(rfind(*ptr,right-1)==right-1)
				{
					flag = true;
					break;
				}
			if(!flag)
				break;
			right--;
		}
		return substr(left,right-left);
	}
开发者ID:EtcDot,项目名称:PomeloCpp,代码行数:34,代码来源:String.cpp

示例2: split

	Strings String::split(Strings tokens) const
	{
		if(tokens.empty())
			tokens.push_back(L" ");

		Strings ans;
		base_wstring nowS;
		IndexVar index = 0;
		while(index<mContent.size())
		{
			bool flag = false;
			for(Strings::iterator ptr = tokens.begin(); ptr != tokens.end(); ptr++)
				if(find(*ptr,index)==index)
				{
					flag = true;
					ans.push_back(nowS);
					nowS = L"";
					break;
				}
			if(!flag)
				nowS += mContent[index];
			index++;
		}
		ans.push_back(nowS);

		return ans;
	}
开发者ID:EtcDot,项目名称:PomeloCpp,代码行数:27,代码来源:String.cpp

示例3: Compile

bool User_Program::Compile (string &text, bool list_flag)
{
	Strings lines;
	Str_Itr line_itr;

	//---- split the text into lines ----

	String_Ptr (text)->Parse (lines, "\n\r\f");

	for (line_itr = lines.begin (); line_itr != lines.end (); line_itr++) {
		line_num++;

		if (list_flag) {
			exe->Print (1, "\t") << *line_itr;
		}
		line_itr->Clean ();
		if (line_itr->empty ()) continue;

		if (declare_flag) {
			if (!Initial_Declare (*line_itr)) break;
		} else if (table_flag) {
			if (!Initial_Table (*line_itr)) break;
		} else {
			while (Get_Token (*line_itr)) {
				if (!Process_Token ()) break;
			}
		}
	}
	return (true);
}
开发者ID:kravitz,项目名称:transims5,代码行数:30,代码来源:Compile.cpp

示例4: lineSlice

std::string 
StringTools::wrap( const std::string &text,
                   int wrapColumn )
{
  const char lineBreak = '\n';
  Strings lines = split( text, lineBreak );

  std::string wrapped;
  for ( Strings::const_iterator it = lines.begin(); it != lines.end(); ++it )
  {
    if ( it != lines.begin() )
      wrapped += lineBreak;

    const std::string &line = *it;
    unsigned int index =0;
    while ( index < line.length() )
    {
      std::string lineSlice( line.substr( index, wrapColumn ) );
      wrapped += lineSlice;
      index += wrapColumn;
      if ( index < line.length() )
        wrapped += lineBreak;
    }
  }

  return wrapped;
}
开发者ID:LTears,项目名称:rktotal,代码行数:27,代码来源:StringTools.cpp

示例5: initialize

bool FfmpegOutput::initialize(const Attributes &attributes)
{
	FfmpegResources::instance().registerAll();

	queryFormats();

	Strings avFormats;
	for(int i=0; i<m_avFormats.size(); ++i)
	{
		avFormats.push_back(m_avFormats[i].name);
	}

	//default mp4
//	std::string avFormatName="mp4";
//	std::string avFormatName="h264";
	std::string avFormatName="f4v";
//	std::string avFormatName="flv";
	Strings::iterator iter=std::find(avFormats.begin(), avFormats.end(), avFormatName);

	if(iter == avFormats.end())
		avFormatName=avFormats[0];
	
	m_enabled=false;
	m_recording=false;
	m_audioRecording=false;

	addAttribute("enable", false);
	addAttribute("outputFormat", avFormatName, avFormats);
	addAttribute("outputLocation", "untitled.mp4");
//	addAttribute("outputLocation", "test.mp4");
//	addAttribute("outputLocation", "test.h264");
//	addAttribute("outputLocation", "rtmp://localhost/live/test");
//	addAttribute("outputLocation", "rtmp://localhost:1935/live/stream");

	m_bufferSampleId=MediaSampleFactory::getTypeId("BufferSample");
	m_ffmpegPacketSampleId=MediaSampleFactory::getTypeId("FfmpegPacketSample");
    m_eventSampleId=Limitless::MediaSampleFactory::getTypeId("EventSample");

	m_videoSinkPad=addSinkPad("Sink", "[{\"mime\":\"video/*\"}, {\"mime\":\"image/*\"}]");
	m_audioSinkPad=addSinkPad("AudioSink", "[{\"mime\":\"audio/raw\"}]");
//	addSinkPad("[{\"mime\":\"audio/*\"}]");

	return true;
}
开发者ID:InfiniteInteractive,项目名称:LimitlessSDK,代码行数:44,代码来源:ffmpegOutput.cpp

示例6: close

void FileUtils::close(Mapper * mapper) {
	Strings * columnNames = mapper->getColumnNames();
	for (Strings::iterator it = columnNames->begin(); it != columnNames->end();
			++it) {
		std::string columnName = *it;
		BulkFileWriter * bulkFileWriter =
				(*(mapper->getColumnsToWriters()))[columnName];
		delete bulkFileWriter;
	}
}
开发者ID:szalaigj,项目名称:MonetDBLoader,代码行数:10,代码来源:FileUtils.cpp

示例7: init

void PluginRegistry::init()
{
    // for each directory
    for( Strings::const_iterator i = _directories.begin();
         i != _directories.end(); ++i )
    {
        const std::string& dir = *i;
        LBLOG( LOG_PLUGIN ) << "Searching plugins in " << dir << std::endl;

#ifdef _WIN32
        Strings files = lunchbox::searchDirectory( dir, "EqualizerCompressor*.dll");
        const char DIRSEP = '\\';
#elif defined (Darwin)
        Strings files = lunchbox::searchDirectory( dir,
                                               "libEqualizerCompressor*.dylib");
        Strings oldFiles = lunchbox::searchDirectory( dir,
                                                  "libeqCompressor*.dylib" );
        files.insert( files.end(), oldFiles.begin(), oldFiles.end( ));
        const char DIRSEP = '/';
#else
        Strings files = lunchbox::searchDirectory( dir,
                                               "libEqualizerCompressor*.so" );
        Strings oldFiles = lunchbox::searchDirectory( dir, "libeqCompressor*.so" );
        files.insert( files.end(), oldFiles.begin(), oldFiles.end( ));
        const char DIRSEP = '/';
#endif
        
        // for each file found in the directory
        for( Strings::const_iterator j = files.begin(); j != files.end(); ++j )
        {
            // build path + name of library
            const std::string libraryName =
                dir.empty() ? *j : dir + DIRSEP + *j;
            addPlugin( libraryName );
        }
    }

    for( Plugins::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i)
    {
        Plugin* plugin = *i;
        plugin->initChildren();
    }
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:43,代码来源:pluginRegistry.cpp

示例8: discoverLocal

void Display::discoverLocal( Config* config )
{
    Node* node = config->findAppNode();
    EQASSERT( node );
    if( !node )
        return;

    const Pipes& pipes = node->getPipes();
    EQASSERT( !pipes.empty( ));
    if( pipes.empty( ))
        return;

    Pipe* pipe = pipes.front();
    Window* window = new Window( pipe );
    window->setViewport( Viewport( .25f, .2f, .5f, .5f ));
    window->setName( pipe->getName() + " window" );
    window->setIAttribute( Window::IATTR_PLANES_STENCIL, 1 );

    Channel* channel = new Channel( window );
    channel->setName( pipe->getName() + " channel" );
    Observer* observer = new Observer( config );

    const PixelViewport& pvp = pipe->getPixelViewport();
    Wall wall;
    if( pvp.isValid( ))
        wall.resizeHorizontalToAR( float( pvp.w ) / float( pvp.h ));

    Canvas* canvas = new Canvas( config );
    canvas->setWall( wall );

    Segment* segment = new Segment( canvas );
    segment->setChannel( channel );

    Strings names;
    names.push_back( EQ_SERVER_CONFIG_LAYOUT_2D_DYNAMIC  );
    names.push_back( EQ_SERVER_CONFIG_LAYOUT_SIMPLE );
    names.push_back( EQ_SERVER_CONFIG_LAYOUT_DB_DS );
    names.push_back( EQ_SERVER_CONFIG_LAYOUT_DB_STATIC );
    names.push_back( EQ_SERVER_CONFIG_LAYOUT_DB_DYNAMIC );
    names.push_back( EQ_SERVER_CONFIG_LAYOUT_2D_STATIC );

    for( StringsCIter i = names.begin(); i != names.end(); ++i )
    {
        Layout* layout = new Layout( config );
        layout->setName( *i );

        View* view = new View( layout );
        view->setObserver( observer );
        view->setWall( wall );

        canvas->addLayout( layout );
    }

    config->activateCanvas( canvas );
}
开发者ID:oliver-e,项目名称:Equalizer,代码行数:55,代码来源:display.cpp

示例9: mt_Get_String

std::string StringManager::mt_Get_String(Strings& strings, const std::string& string_id, const GameStringArguments& args)
{
	std::string l_ret;
	auto l_str(strings.find(string_id));

	if (l_str != strings.end())
	{
		l_ret = l_str->second.mt_Get_String(args);
	}

	return l_ret;
}
开发者ID:Tigole,项目名称:rpg_engine,代码行数:12,代码来源:StringManager.cpp

示例10: get_part_of_sampling_space

ProteinsAnchorsSamplingSpace get_part_of_sampling_space(
    const ProteinsAnchorsSamplingSpace &prots_ss, const Strings &prot_names) {
  ProteinsAnchorsSamplingSpace ret(multifit::get_partial_proteomics_data(
      prots_ss.get_proteomics_data(), prot_names));
  ret.set_anchors(prots_ss.get_anchors());
  // add the paths
  for (Strings::const_iterator it = prot_names.begin(); it != prot_names.end();
       it++) {
    ret.set_paths_for_protein(*it, prots_ss.get_paths_for_protein(*it));
  }
  return ret;
}
开发者ID:salilab,项目名称:imp,代码行数:12,代码来源:protein_anchors_mapping_reader.cpp

示例11: deleteFile

void FileUtils::deleteFile(std::string bulkDirectory, Mapper * mapper) {
	Strings * columnNames = mapper->getColumnNames();
	for (Strings::iterator it = columnNames->begin(); it != columnNames->end();
			++it) {
		std::string columnName = *it;
		std::string fileName = mapper->getFilename(bulkDirectory, columnName);
		std::ifstream columnFile(fileName.c_str());
		if (columnFile.good()) {
			columnFile.close();
			remove(fileName.c_str());
		}
	}
}
开发者ID:szalaigj,项目名称:MonetDBLoader,代码行数:13,代码来源:FileUtils.cpp

示例12:

bool
OracleDialect::table_exists(SqlConnection &conn, const String &table)
{
    Strings s = get_tables(conn);
    for (Strings::iterator i = s.begin(); i != s.end(); ++i)
    {
        if (*i == table)
        {
            return true;
        }
    }
    return false;
}
开发者ID:CarverLab,项目名称:yb-orm,代码行数:13,代码来源:dialect_oracle.cpp

示例13: Start_Execution

int Execution_Service::Start_Execution (Strings keys) 
{
	Str_Itr key_itr;
	char *config_file;

	Program_Status (RUNNING);
	
	Show_Banner ();

	//---- check for a config file ----

	config_file = get_env ("TRANSIMS_CONFIG_FILE");

	if (config_file != 0) {
		if (!Read_Control_File (config_file)) {
			return (Return_Code ());
		}
	}

	//---- process the control keys ----
	
	for (key_itr = keys.begin (); key_itr != keys.end (); key_itr++) {
		Process_Control_String (key_itr->c_str ());
	}

	//---- open the output report ----

	if (Check_Control_Key (TITLE)) {
		Title (Get_Control_String (TITLE));
	}
	Open_Report (Get_Control_String (REPORT_DIRECTORY), Get_Control_String (REPORT_FILE), Set_Control_Flag (REPORT_FLAG));
	
	if (report_flag) Read_Reports ();
		
	set_new_handler (Insufficient_Memory);

	//---- start processing ----

	Program_Control ();

	if (report_flag) {
		List_Reports ();
	} else if (!Highest_Control_Group (PROGRAM_REPORTS, 0)) {
		Print (1);
		Flush ();
	}
	Execute ();

	return (Return_Code ());
}
开发者ID:qingswu,项目名称:Transim,代码行数:50,代码来源:Execution_Service.cpp

示例14: Add_Breaks

bool Data_Range::Add_Breaks (string text)
{
	int low, high;
	double d1, d2;
	Strings breaks;
	Str_Itr itr;

	//---- check for special conditions ----

	if (text.empty () || text [0] == '\n') return (true);

	if (String_Ptr (text)->Equals ("None")) {
		return (Add_Range (minimum, maximum));
	}

	//---- unpack the break string ----	

	low = minimum;

	String_Ptr (text)->Parse (breaks);

	for (itr = breaks.begin (); itr != breaks.end (); itr++) {
		if (!String_Ptr (*itr)->Range (d1, d2)) continue;

		if (d1 == 0.0 && d2 == 0.0) continue;
		if (d2 > d1) goto break_error;

		high = DTOI (d2 * factor);

		if (low > high || low < minimum || high > maximum) goto break_error;

		if (low < high) {
			if (!Add_Range (low, high)) return (false);
		}
		low = high;
	}
	high = maximum;

	if (low < high) {
		return (Add_Range (low, high));
	}
	return (Num_Ranges () > 0);

break_error:
	if (exe->Send_Messages ()) {
		exe->Error (String ("Range Breaks %s are Illogical") % text);
	}
	return (false);
}
开发者ID:kravitz,项目名称:transims5,代码行数:49,代码来源:Data_Range.cpp

示例15: normalizeLines

static void normalizeLines(Strings& in, StringsSet& out, bool sortWords, bool ignoreBlankLines,
                           char wordsep = ' ') {
    Strings::iterator begin = in.begin(), end = in.end(), i = begin, o = begin;
    for (; i != end; ++i) {
        std::string& line = *i;
        normalizeLine(line, sortWords, wordsep);
        bool empty = ignoreBlankLines && line.empty();
        if (!empty) {
            out.insert(line);
            if (i != o) *o = std::move(*i);
            ++o;
        }
    }
    in.erase(o, end);
}
开发者ID:ryancotterell,项目名称:hyp,代码行数:15,代码来源:Equal.cpp


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