MCPcopy Create free account
hub / github.com/BobbyAnguelov/Esoterica / GetIntraFilePathParent

Method GetIntraFilePathParent

Code/Base/FileSystem/DataPath.cpp:353–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351 return m_path.substr( m_lastPathDelimiterIdx + 1, m_extensionDelimiterIdx - m_lastPathDelimiterIdx - 1 );
352 }
353
354 String DataPath::GetDirectoryName() const
355 {
356 EE_ASSERT( IsValid() && IsDirectoryPath() );
357
358 size_t idx = m_path.rfind( s_pathDelimiter );
359 EE_ASSERT( idx != String::npos );
360
361 idx = m_path.rfind( s_pathDelimiter, Math::Max( size_t( 0 ), idx - 1 ) );
362 if ( idx == String::npos )
363 {
364 return String();
365 }
366
367 idx++;
368 return m_path.substr( idx, m_path.length() - idx - 1 );
369 }
370
371 bool DataPath::HasParentDirectory() const
372 {
373 EE_ASSERT( IsValid() );

Callers 3

GetParentResourceIDMethod · 0.80
OnFileDeletedMethod · 0.80
DoesFileExistMethod · 0.80

Calls 4

DecomposePathStringMethod · 0.80
IsValidFunction · 0.70
DataPathClass · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected