Exemplo n.º 1
0
            // Special HasParentDirectory impl for VariablePaths
            internal static bool HasParentDirectory(string path)
            {
                Debug.Assert(path != null);

                if (!MiscHelpers.HasParentDirectory(path))
                {
                    return(false);
                }
                var lastName = MiscHelpers.GetLastName(path);

                // Here, we ensure that there is no variable defined into the last fileName or directoryName!
                return(!DoesFileNameContainVariable(lastName));
            }
            internal static string GetFileNameExtension(string path)
            {
                Argument.IsNotNull(nameof(path), path);

                var fileName = MiscHelpers.GetLastName(path);
                var index    = fileName.LastIndexOf('.');

                if (index == -1)
                {
                    return(string.Empty);
                }

                return(index == fileName.Length - 1
                                        ? string.Empty
                                        : fileName.Substring(index, fileName.Length - index));
            }
Exemplo n.º 3
0
            internal static string GetFileNameExtension(string path)
            {
                Debug.Assert(path != null);
                var fileName = MiscHelpers.GetLastName(path);
                var index    = fileName.LastIndexOf('.');

                if (index == -1)
                {
                    return(string.Empty);
                }
                if (index == fileName.Length - 1)
                {
                    return(string.Empty);
                }
                return(fileName.Substring(index, fileName.Length - index));
            }
            internal static string GetFileName(string path)
            {
                Argument.IsNotNull(nameof(path), path);

                return(MiscHelpers.GetLastName(path));
            }
Exemplo n.º 5
0
 //
 //  FileName and extension
 //
 internal static string GetFileName(string path)
 {
     Debug.Assert(path != null);
     return(MiscHelpers.GetLastName(path));
 }