Ejemplo n.º 1
0
euint8 cd(euint8* FolderName)
{
	SDfile File2[200];
	SDfolder Folder2[200];
	if(FolderName == "." )
		return 0;
	if(FolderName=="..")
	{
		return -1;
	}
	read_directory(File2,Folder2,currDir);
	euint8* search = (euint8*)malloc(strlen(FolderName) - LastIndexOf('/',FolderName));
	strCopyLen(FolderName,search,LastIndexOf('/',FolderName));
	euint16 counter=0;
	while(!(Folder2[counter].startH ==0 && Folder2[counter].startL==0)&&counter<20)
	{
		if(strcompare2(Folder2[counter].name,search)==0)
		{
			//we have found our folder
			//now we need to update our pointers
			currDir = Folder2[counter];
			//free(search);
			return 0;
		}
		++counter;
	}
	free(search);
	return -1;
}
Ejemplo n.º 2
0
FarFileName FarFileName::GetExt() const
{
  int p = LastIndexOf ('.');
  if (p == -1)
    return FarFileName (".");
  return FarFileName (Mid (p));
}
Ejemplo n.º 3
0
CString CStringExt::GetFileExt(CString fn,LPCTSTR notFound)
{
	int i=LastIndexOf(fn,_T('.'));
	if(i<0) return notFound;
	CString ret(fn);
	return ret.Right(ret.GetLength()-i-1);
}
Ejemplo n.º 4
0
nsSupportsArray::RemoveLastElement(const nsISupports* aElement)
{
  PRInt32 theIndex = LastIndexOf(aElement);
  if (theIndex >= 0)
    return RemoveElementAt(theIndex);

  return PR_FALSE;
}
Ejemplo n.º 5
0
nsSupportsArray::RemoveLastElement(const nsISupports* aElement)
{
  int32_t theIndex = LastIndexOf(aElement);
  if (theIndex >= 0)
    return RemoveElementAt(theIndex);

  return false;
}
Ejemplo n.º 6
0
void FarFileName::SetExt (const FarFileName& ext)
{
  FarFileName ffn = ext.GetExt();

  int nPos = LastIndexOf( '.' );
  if ( nPos != -1 )
    Delete( nPos, Length() - nPos );

  operator+=( ffn );
}
Ejemplo n.º 7
0
long FString::LastIndexOf (const char *substr, long endIndex) const
{
	return LastIndexOf (substr, endIndex, strlen(substr));
}
Ejemplo n.º 8
0
long FString::LastIndexOf (const FString &substr, long endIndex) const
{
	return LastIndexOf (substr.Chars, endIndex, substr.Len());
}
Ejemplo n.º 9
0
long FString::LastIndexOf (char subchar) const
{
	return LastIndexOf (subchar, long(Len()));
}
Ejemplo n.º 10
0
long FString::LastIndexOf (const char *substr) const
{
	return LastIndexOf (substr, long(Len()), strlen(substr));
}
Ejemplo n.º 11
0
long FString::LastIndexOf (const FString &substr) const
{
	return LastIndexOf (substr.Chars, long(Len()), substr.Len());
}