RTPathParse.cpp revision e5dc0696566fc781da74690258b826515e7d496e
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * IPRT - RTPathParse
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * Copyright (C) 2006-2013 Oracle Corporation
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * available from http://www.virtualbox.org. This file is free software;
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * General Public License (GPL) as published by the Free Software
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * The contents of this file may alternatively be used under the terms
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * of the Common Development and Distribution License Version 1.0
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * VirtualBox OSE distribution, in which case the provisions of the
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * CDDL are applicable instead of those of the GPL.
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * You may elect to license modified versions of this file under the
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * terms and conditions of either the GPL or the CDDL or both.
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync/*******************************************************************************
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync* Header Files *
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync*******************************************************************************/
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsyncRTDECL(int) RTPathParse(const char *pszPath, PRTPATHPARSED pParsed, size_t cbParsed, uint32_t fFlags)
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * Input validation.
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync AssertReturn(cbParsed >= RT_UOFFSETOF(RTPATHPARSED, aComps), VERR_INVALID_PARAMETER);
e5dc0696566fc781da74690258b826515e7d496evboxsync AssertReturn(RTPATH_STR_F_IS_VALID(fFlags, 0), VERR_INVALID_FLAGS);
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync * Invoke the worker for the selected path style.
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync return rtPathParseStyleDos(pszPath, pParsed, cbParsed, fFlags);
d070ebeb94124ca435b7eba7f66a1bbd1bb6c1f9vboxsync return rtPathParseStyleUnix(pszPath, pParsed, cbParsed, fFlags);
e5dc0696566fc781da74690258b826515e7d496evboxsync AssertFailedReturn(VERR_INVALID_FLAGS); /* impossible */