VirtualBox

source: vbox/trunk/src/VBox/Runtime/include/internal/path.h@ 28381

Last change on this file since 28381 was 26476, checked in by vboxsync, 15 years ago

iprt: Added RTPathCountComponents, RTPathCopyComponents, RTGetOptArgvFromString and RTGetOptArgvFree.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1/* $Id: path.h 26476 2010-02-13 02:06:41Z vboxsync $ */
2/** @file
3 * IPRT - RTPath Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31#ifndef ___internal_path_h
32#define ___internal_path_h
33
34#include <iprt/cdefs.h>
35#include <iprt/param.h>
36
37RT_C_DECLS_BEGIN
38
39#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
40# define HAVE_UNC 1
41# define HAVE_DRIVE 1
42#endif
43
44
45DECLHIDDEN(size_t) rtPathRootSpecLen(const char *pszPath);
46DECLHIDDEN(size_t) rtPathVolumeSpecLen(const char *pszPath);
47DECLHIDDEN(int) rtPathPosixRename(const char *pszSrc, const char *pszDst, unsigned fRename, RTFMODE fFileType);
48DECLHIDDEN(int) rtPathWin32MoveRename(const char *pszSrc, const char *pszDst, uint32_t fFlags, RTFMODE fFileType);
49
50
51/**
52 * Converts a path from IPRT to native representation.
53 *
54 * This may involve querying filesystems what codeset they
55 * speak and so forth.
56 *
57 * @returns IPRT status code.
58 * @param ppszNativePath Where to store the pointer to the native path.
59 * Free by calling rtPathFreeHost(). NULL on failure.
60 * @param pszPath The path to convert.
61 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
62 */
63int rtPathToNative(char **ppszNativePath, const char *pszPath);
64
65/**
66 * Converts a path from IPRT to native representation.
67 *
68 * This may involve querying filesystems what codeset they
69 * speak and so forth.
70 *
71 * @returns IPRT status code.
72 * @param ppszNativePath Where to store the pointer to the native path.
73 * Free by calling rtPathFreeHost(). NULL on failure.
74 * @param pszPath The path to convert.
75 * @param pszBasePath What pszPath is relative to. If NULL the function behaves like rtPathToNative().
76 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
77 */
78int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath);
79
80/**
81 * Frees a native path returned by rtPathToNative() or rtPathToNativeEx().
82 *
83 * @param pszNativePath The host path to free. NULL allowed.
84 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
85 */
86void rtPathFreeNative(char *pszNativePath);
87
88/**
89 * Converts a path from the native to the IPRT representation.
90 *
91 * @returns IPRT status code.
92 * @param ppszPath Where to store the pointer to the IPRT path.
93 * Free by calling RTStrFree(). NULL on failure.
94 * @param pszNativePath The native path to convert.
95 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
96 */
97int rtPathFromNative(char **ppszPath, const char *pszNativePath);
98
99/**
100 * Converts a path from the native to the IPRT representation.
101 *
102 * @returns IPRT status code.
103 * @param ppszPath Where to store the pointer to the IPRT path.
104 * Free by calling RTStrFree(). NULL on failure.
105 * @param pszNativePath The native path to convert.
106 * @param pszBasePath What pszHostPath is relative to - in IPRT representation.
107 * If NULL the function behaves like rtPathFromNative().
108 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
109 */
110int rtPathFromNativeEx(char **ppszPath, const char *pszNativePath, const char *pszBasePath);
111
112
113RT_C_DECLS_END
114
115#endif
116
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette