mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
separate out is_pathsep
This commit is contained in:
parent
09d7fb02d8
commit
8a9358adb3
@ -98,6 +98,7 @@
|
|||||||
load_plugin.cxx load_plugin.h \
|
load_plugin.cxx load_plugin.h \
|
||||||
fileSpec.cxx fileSpec.h fileSpec.I \
|
fileSpec.cxx fileSpec.h fileSpec.I \
|
||||||
find_root_dir.cxx find_root_dir.h \
|
find_root_dir.cxx find_root_dir.h \
|
||||||
|
is_pathsep.h is_pathsep.I \
|
||||||
mkdir_complete.cxx mkdir_complete.h
|
mkdir_complete.cxx mkdir_complete.h
|
||||||
|
|
||||||
#end static_lib_target
|
#end static_lib_target
|
||||||
|
33
direct/src/plugin/is_pathsep.I
Normal file
33
direct/src/plugin/is_pathsep.I
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Filename: is_pathsep.I
|
||||||
|
// Created by: drose (07Jul09)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the revised BSD
|
||||||
|
// license. You should have received a copy of this license along
|
||||||
|
// with this source code in a file named "LICENSE."
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: is_pathsep
|
||||||
|
// Description: Returns true if the indicated character is a path
|
||||||
|
// separator character (e.g. slash or backslash), false
|
||||||
|
// otherwise.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
inline bool
|
||||||
|
is_pathsep(char ch) {
|
||||||
|
if (ch == '/') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (ch == '\\') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
23
direct/src/plugin/is_pathsep.h
Normal file
23
direct/src/plugin/is_pathsep.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Filename: is_pathsep.h
|
||||||
|
// Created by: drose (07Jul09)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the revised BSD
|
||||||
|
// license. You should have received a copy of this license along
|
||||||
|
// with this source code in a file named "LICENSE."
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef IS_PATHSEP_H
|
||||||
|
#define IS_PATHSEP_H
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
is_pathsep(char ch);
|
||||||
|
|
||||||
|
#include "is_pathsep.I"
|
||||||
|
|
||||||
|
#endif
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "load_plugin.h"
|
#include "load_plugin.h"
|
||||||
#include "p3d_plugin_config.h"
|
#include "p3d_plugin_config.h"
|
||||||
|
#include "is_pathsep.h"
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
|
|
||||||
@ -74,25 +75,6 @@ get_plugin_basename() {
|
|||||||
return default_plugin_filename + dll_ext;
|
return default_plugin_filename + dll_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: is_pathsep
|
|
||||||
// Description: Returns true if the indicated character is a path
|
|
||||||
// separator character (e.g. slash or backslash), false
|
|
||||||
// otherwise.
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
static inline bool
|
|
||||||
is_pathsep(char ch) {
|
|
||||||
if (ch == '/') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
|
||||||
if (ch == '\\') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: find_extension_dot
|
// Function: find_extension_dot
|
||||||
// Description: Returns the position in the string of the dot before
|
// Description: Returns the position in the string of the dot before
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "mkdir_complete.h"
|
#include "mkdir_complete.h"
|
||||||
|
#include "is_pathsep.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -24,25 +25,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: is_pathsep
|
|
||||||
// Description: Returns true if the indicated character is a path
|
|
||||||
// separator character (e.g. slash or backslash), false
|
|
||||||
// otherwise.
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
static inline bool
|
|
||||||
is_pathsep(char ch) {
|
|
||||||
if (ch == '/') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
|
||||||
if (ch == '\\') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: get_dirname
|
// Function: get_dirname
|
||||||
// Description: Returns the directory component of the indicated
|
// Description: Returns the directory component of the indicated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user