forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace file_util.{h,cpp} by std::filesystem
With C++ 17 we can use the STL-provided implementation instead of rolling our own (platform-dependent) code.
- Loading branch information
1 parent
bf6d759
commit 5664950
Showing
19 changed files
with
103 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,15 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "java_class_loader_base.h" | ||
|
||
#include "jar_file.h" | ||
#include "java_bytecode_parse_tree.h" | ||
#include "java_bytecode_parser.h" | ||
|
||
#include <util/file_util.h> | ||
#include <util/message.h> | ||
#include <util/prefix.h> | ||
#include <util/suffix.h> | ||
|
||
#include "jar_file.h" | ||
#include "java_bytecode_parse_tree.h" | ||
#include "java_bytecode_parser.h" | ||
|
||
#include <filesystem> | ||
#include <fstream> | ||
|
||
void java_class_loader_baset::add_classpath_entry( | ||
|
@@ -40,7 +40,7 @@ void java_class_loader_baset::add_classpath_entry( | |
} | ||
else | ||
{ | ||
if(is_directory(path)) | ||
if(std::filesystem::is_directory(path)) | ||
{ | ||
classpath_entries.push_back( | ||
classpath_entryt(classpath_entryt::DIRECTORY, path)); | ||
|
@@ -197,7 +197,8 @@ java_class_loader_baset::get_class_from_directory( | |
{ | ||
// Look in the given directory | ||
const std::string class_file = class_name_to_os_file(class_name); | ||
const std::string full_path = concat_dir_file(path, class_file); | ||
const std::string full_path = | ||
std::filesystem::path(path).append(class_file).string(); | ||
|
||
if(std::ifstream(full_path)) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.