예제 #1
0
	bool _VariableModifier_Type( eastl::string& str, const eastl::string& vname, const char* modifier, eastl::string& type )//是否为某种修饰类型的变量
	{
		size_t start_pos = 0;
		do 
		{
			start_pos = str.find( vname, start_pos );
			if ( start_pos != eastl::string::npos )
			{
				size_t trunk = str.find_last_of( ';', start_pos );
				trunk = trunk != eastl::string::npos ? trunk : 0;
				string substr = str.substr( trunk, start_pos - trunk );
				size_t istype = substr.find( modifier );
				if ( istype != eastl::string::npos )
				{
					type = substr.substr( substr.find_first_of(' ') );
					return true;
				}
				start_pos += vname.size();
			}
		} while ( start_pos != eastl::string::npos );
		return false;
	}
예제 #2
0
	//---------------------------------------------------------------------------------------------------------
	eastl::string _GetVariableName( const eastl::string& str, std::size_t begin, std::size_t dir )//得到变量全名
	{
		size_t spb = begin;
		size_t spe;
		while(true)
		{
			spb += dir;
			if ( !Utility::NotVariablePart( str[spb] ) )
			{
				spe = spb + dir;
				break;
			}
		}
		while(true)
		{
			spe += dir;
			if ( Utility::NotVariablePart( str[spe] ) )
			{
				break;
			}
		}
		return str.substr( (spb < spe ? spb : spe)+1, spb < spe ? spe - spb : spb - spe );
	}