rtPathVolumeSpecLen.cpp revision b6b40d21fb1ce43de5586f09e3469f17c06d4d88
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * IPRT - rtPathVolumeSpecLen
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * Copyright (C) 2006-2007 Oracle Corporation
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * available from http://www.virtualbox.org. This file is free software;
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * you can redistribute it and/or modify it under the terms of the GNU
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * General Public License (GPL) as published by the Free Software
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
94872a0e88ab4f38c786fcf617ddeb4b63a76957vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
78a072e1b56619e3230735ae073668311232ec94vboxsync * The contents of this file may alternatively be used under the terms
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync * of the Common Development and Distribution License Version 1.0
78a072e1b56619e3230735ae073668311232ec94vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
78a072e1b56619e3230735ae073668311232ec94vboxsync * VirtualBox OSE distribution, in which case the provisions of the
78a072e1b56619e3230735ae073668311232ec94vboxsync * CDDL are applicable instead of those of the GPL.
78a072e1b56619e3230735ae073668311232ec94vboxsync * You may elect to license modified versions of this file under the
78a072e1b56619e3230735ae073668311232ec94vboxsync * terms and conditions of either the GPL or the CDDL or both.
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync/*******************************************************************************
78a072e1b56619e3230735ae073668311232ec94vboxsync* Header Files *
78a072e1b56619e3230735ae073668311232ec94vboxsync*******************************************************************************/
c3d2b15ad840b405062f4c2c6b127d6fc107c7b2vboxsync * Returns the length of the volume name specifier of the given path.
78a072e1b56619e3230735ae073668311232ec94vboxsync * If no such specifier zero is returned.
78a072e1b56619e3230735ae073668311232ec94vboxsyncDECLHIDDEN(size_t) rtPathVolumeSpecLen(const char *pszPath)
78a072e1b56619e3230735ae073668311232ec94vboxsync /* UNC path. */
78a072e1b56619e3230735ae073668311232ec94vboxsync /** @todo r=bird: it's UNC and we have to check that the next char isn't a
78a072e1b56619e3230735ae073668311232ec94vboxsync * slash, then skip both the server and the share name. */
78a072e1b56619e3230735ae073668311232ec94vboxsync /* Drive letter. */
78a072e1b56619e3230735ae073668311232ec94vboxsync /* This isn't quite right when looking at the above stuff, but it works assuming that '//' does not mean UNC. */
78a072e1b56619e3230735ae073668311232ec94vboxsync /// @todo (dmik) well, it's better to consider there's no volume name
78a072e1b56619e3230735ae073668311232ec94vboxsync // at all on *nix systems
78a072e1b56619e3230735ae073668311232ec94vboxsync// return pszPath && pszPath[0] == '/';