[Bf-blender-cvs] [d70519b] gooseberry: Removed now-unused util_path files from the pointcache lib.

Lukas Tönne noreply at git.blender.org
Mon Mar 23 13:02:25 CET 2015


Commit: d70519b28489a78a010b1fcb545da8efb4a83099
Author: Lukas Tönne
Date:   Tue Mar 3 17:41:54 2015 +0100
Branches: gooseberry
https://developer.blender.org/rBd70519b28489a78a010b1fcb545da8efb4a83099

Removed now-unused util_path files from the pointcache lib.

Paths are constructed outside this module now. A valid absolute path
should always be provided through the API calls.

===================================================================

M	source/blender/pointcache/CMakeLists.txt
M	source/blender/pointcache/PTC_api.cpp
M	source/blender/pointcache/alembic/abc_cloth.cpp
M	source/blender/pointcache/alembic/abc_mesh.cpp
M	source/blender/pointcache/alembic/abc_particles.cpp
D	source/blender/pointcache/util/util_path.cpp
D	source/blender/pointcache/util/util_path.h

===================================================================

diff --git a/source/blender/pointcache/CMakeLists.txt b/source/blender/pointcache/CMakeLists.txt
index 7d9872e..5bac46b 100644
--- a/source/blender/pointcache/CMakeLists.txt
+++ b/source/blender/pointcache/CMakeLists.txt
@@ -47,8 +47,6 @@ set(SRC
 
 	util/util_error_handler.h
 	util/util_error_handler.cpp
-	util/util_path.h
-	util/util_path.cpp
 	util/util_types.h
 
 	PTC_api.h
diff --git a/source/blender/pointcache/PTC_api.cpp b/source/blender/pointcache/PTC_api.cpp
index f856629..c145ff9 100644
--- a/source/blender/pointcache/PTC_api.cpp
+++ b/source/blender/pointcache/PTC_api.cpp
@@ -27,7 +27,6 @@
 #include "export.h"
 
 #include "ptc_types.h"
-#include "util_path.h"
 
 extern "C" {
 #include "BLI_listbase.h"
diff --git a/source/blender/pointcache/alembic/abc_cloth.cpp b/source/blender/pointcache/alembic/abc_cloth.cpp
index dfc7d86..1cd95d3 100644
--- a/source/blender/pointcache/alembic/abc_cloth.cpp
+++ b/source/blender/pointcache/alembic/abc_cloth.cpp
@@ -17,7 +17,6 @@
  */
 
 #include "abc_cloth.h"
-#include "util_path.h"
 
 extern "C" {
 #include "BLI_math.h"
diff --git a/source/blender/pointcache/alembic/abc_mesh.cpp b/source/blender/pointcache/alembic/abc_mesh.cpp
index 6954c93..5faec1f 100644
--- a/source/blender/pointcache/alembic/abc_mesh.cpp
+++ b/source/blender/pointcache/alembic/abc_mesh.cpp
@@ -17,7 +17,6 @@
  */
 
 #include "abc_mesh.h"
-#include "util_path.h"
 
 extern "C" {
 #include "BLI_math.h"
diff --git a/source/blender/pointcache/alembic/abc_particles.cpp b/source/blender/pointcache/alembic/abc_particles.cpp
index f1fe522..6dcbbb5 100644
--- a/source/blender/pointcache/alembic/abc_particles.cpp
+++ b/source/blender/pointcache/alembic/abc_particles.cpp
@@ -18,7 +18,6 @@
 
 #include "abc_cloth.h"
 #include "abc_particles.h"
-#include "util_path.h"
 
 extern "C" {
 #include "BLI_math.h"
diff --git a/source/blender/pointcache/util/util_path.cpp b/source/blender/pointcache/util/util_path.cpp
deleted file mode 100644
index c22b392..0000000
--- a/source/blender/pointcache/util/util_path.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2013, Blender Foundation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <string.h> /* XXX needed for missing type declarations in BLI ... */
-
-#include "util_path.h"
-
-extern "C" {
-#include "BLI_fileops.h"
-#include "BLI_path_util.h"
-#include "BLI_string.h"
-#include "BLI_utildefines.h"
-
-#include "DNA_ID.h"
-
-#include "BKE_appdir.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-}
-
-namespace PTC {
-
-static std::string default_filename = std::string("blendcache");
-
-BLI_INLINE bool path_is_rel(const std::string &path)
-{
-	return BLI_path_is_rel(path.c_str());
-}
-
-BLI_INLINE bool is_dir(const std::string &path)
-{
-	return BLI_is_dir(path.c_str());
-}
-
-BLI_INLINE bool path_is_dirpath(const std::string &path)
-{
-	/* last char is a slash? */
-	return *(BLI_last_slash(path.c_str()) + 1) == '\0';
-}
-
-BLI_INLINE std::string path_join_dirfile(const std::string &dir, const std::string &file)
-{
-	char path[FILE_MAX];
-	BLI_join_dirfile(path, sizeof(path), dir.c_str(), file.c_str());
-	return std::string(path);
-}
-
-BLI_INLINE std::string path_abs(const std::string &path, const std::string &basepath)
-{
-	char npath[FILE_MAX];
-	BLI_strncpy(npath, path.c_str(), sizeof(npath));
-	BLI_path_abs(npath, basepath.c_str());
-	return std::string(npath);
-}
-
-bool ptc_archive_path_test(const std::string &path, const ID *UNUSED(id), Library *lib)
-{
-	if (path_is_rel(path)) {
-		if (!(G.relbase_valid || lib))
-			return false;
-	}
-	
-	return true;
-}
-
-std::string ptc_archive_path(const std::string &path, const ID *id, Library *lib)
-{
-	std::string result = "";
-	
-	std::string abspath;
-	if (path_is_rel(path)) {
-		if (G.relbase_valid || lib) {
-			std::string relbase = lib ? lib->filepath: G.main->name;
-			abspath = path_abs(path, relbase);
-		}
-		else
-			return "";
-	}
-	else {
-		abspath = path;
-	}
-	
-	if (path_is_dirpath(abspath) || is_dir(abspath)) {
-		result = path_join_dirfile(abspath, id ? id->name+2 : default_filename);
-	}
-	else {
-		result = abspath;
-	}
-	
-	return result;
-}
-
-} /* namespace PTC */
diff --git a/source/blender/pointcache/util/util_path.h b/source/blender/pointcache/util/util_path.h
deleted file mode 100644
index 3120a14..0000000
--- a/source/blender/pointcache/util/util_path.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2013, Blender Foundation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef PTC_UTIL_PATH_H
-#define PTC_UTIL_PATH_H
-
-#include <string>
-
-struct ID;
-struct Library;
-
-namespace PTC {
-
-bool ptc_archive_path_test(const std::string &path, const ID *id, Library *lib);
-std::string ptc_archive_path(const std::string &path, const ID *id, Library *lib);
-
-} /* namespace PTC */
-
-#endif  /* PTC_UTIL_PATH_H */




More information about the Bf-blender-cvs mailing list