Exemplo n.º 1
0
void FModuleManager::FindModules(const TCHAR* WildcardWithoutExtension, TArray<FName>& OutModules)
{
	// @todo plugins: Try to convert existing use cases to use plugins, and get rid of this function
#if !IS_MONOLITHIC

	TMap<FName, FString> ModulePaths;
	FindModulePaths(WildcardWithoutExtension, ModulePaths);

	for(TMap<FName, FString>::TConstIterator Iter(ModulePaths); Iter; ++Iter)
	{
		if(CheckModuleCompatibility(*Iter.Value()))
		{
			OutModules.Add(Iter.Key());
		}
	}

#else
	FString Wildcard(WildcardWithoutExtension);
	for (FStaticallyLinkedModuleInitializerMap::TConstIterator It(StaticallyLinkedModuleInitializers); It; ++It)
	{
		if (It.Key().ToString().MatchesWildcard(Wildcard))
		{
			OutModules.Add(It.Key());
		}
	}
#endif
}
Exemplo n.º 2
0
Arquivo: util.c Projeto: beave/sagan
bool Wildcard( char *first, char *second )
{
    if (*first == '\0' && *second == '\0')
        {
            return true;
        }

    if (*first == '*' && *(first+1) != '\0' && *second == '\0')
        {
            return false;
        }

    if (*first == '?' || *first == *second)
        {
            return Wildcard(first+1, second+1);
        }

    if (*first == '*')
        {
            return Wildcard(first+1, second) || Wildcard(first, second+1);
        }

    return false;
}
Exemplo n.º 3
0
// NOTE: this method is slow because a temporary string must be created!
// It's much faster to work with unnamed wildcards ("?") and set them directly by Idx!
int CCommand::BindingIndexOf(CAttrID AttrID) const
{
#ifdef _DEBUG
	n_message("Performance warning - CCommand::BindingIndexOf(CAttrID AttrID)");
#endif

	n_assert(SQLiteStmt);

	nString Wildcard(":");
	Wildcard.Append(AttrID->GetName());
	int Idx = sqlite3_bind_parameter_index(SQLiteStmt, Wildcard.Get());
	n_assert2(Idx > 0, "Invalid wildcard Name.");

	// Sqlite's indices are 1-based, convert to 0-based
	return Idx - 1; 
}