VirtualBox

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

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

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1/* $Id: path.h 28800 2010-04-27 08:22:32Z vboxsync $ */
2/** @file
3 * IPRT - RTPath Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. 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
27#ifndef ___internal_path_h
28#define ___internal_path_h
29
30#include <iprt/cdefs.h>
31#include <iprt/param.h>
32
33RT_C_DECLS_BEGIN
34
35#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
36# define HAVE_UNC 1
37# define HAVE_DRIVE 1
38#endif
39
40
41DECLHIDDEN(size_t) rtPathRootSpecLen(const char *pszPath);
42DECLHIDDEN(size_t) rtPathVolumeSpecLen(const char *pszPath);
43DECLHIDDEN(int) rtPathPosixRename(const char *pszSrc, const char *pszDst, unsigned fRename, RTFMODE fFileType);
44DECLHIDDEN(int) rtPathWin32MoveRename(const char *pszSrc, const char *pszDst, uint32_t fFlags, RTFMODE fFileType);
45
46
47/**
48 * Converts a path from IPRT to native representation.
49 *
50 * This may involve querying filesystems what codeset they
51 * speak and so forth.
52 *
53 * @returns IPRT status code.
54 * @param ppszNativePath Where to store the pointer to the native path.
55 * Free by calling rtPathFreeHost(). NULL on failure.
56 * @param pszPath The path to convert.
57 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
58 */
59int rtPathToNative(char **ppszNativePath, const char *pszPath);
60
61/**
62 * Converts a path from IPRT to native representation.
63 *
64 * This may involve querying filesystems what codeset they
65 * speak and so forth.
66 *
67 * @returns IPRT status code.
68 * @param ppszNativePath Where to store the pointer to the native path.
69 * Free by calling rtPathFreeHost(). NULL on failure.
70 * @param pszPath The path to convert.
71 * @param pszBasePath What pszPath is relative to. If NULL the function behaves like rtPathToNative().
72 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
73 */
74int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath);
75
76/**
77 * Frees a native path returned by rtPathToNative() or rtPathToNativeEx().
78 *
79 * @param pszNativePath The host path to free. NULL allowed.
80 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
81 */
82void rtPathFreeNative(char *pszNativePath);
83
84/**
85 * Converts a path from the native to the IPRT representation.
86 *
87 * @returns IPRT status code.
88 * @param ppszPath Where to store the pointer to the IPRT path.
89 * Free by calling RTStrFree(). NULL on failure.
90 * @param pszNativePath The native path to convert.
91 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
92 */
93int rtPathFromNative(char **ppszPath, const char *pszNativePath);
94
95/**
96 * Converts a path from the native to the IPRT representation.
97 *
98 * @returns IPRT status code.
99 * @param ppszPath Where to store the pointer to the IPRT path.
100 * Free by calling RTStrFree(). NULL on failure.
101 * @param pszNativePath The native path to convert.
102 * @param pszBasePath What pszHostPath is relative to - in IPRT representation.
103 * If NULL the function behaves like rtPathFromNative().
104 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
105 */
106int rtPathFromNativeEx(char **ppszPath, const char *pszNativePath, const char *pszBasePath);
107
108
109RT_C_DECLS_END
110
111#endif
112
Note: See TracBrowser for help on using the repository browser.

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