Skip to content

Commit 2951029

Browse files
committed
Untested version - replaced filesystem and regex with standard headers.
1 parent 7349985 commit 2951029

18 files changed

+121
-149
lines changed

opcplusplus/Inc/Driver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ class opDriver
4848
static bool ValidateDialectFiles(const opParameters& p);
4949

5050
// get the latest timestamp of all dialects used
51-
static time_t GetDialectTimestamp(const opParameters& p);
51+
static std::filesystem::file_time_type GetDialectTimestamp(const opParameters& p);
5252

5353
// get the latest timestamp of all generated dialects used
54-
static time_t GetGeneratedDialectTimestamp(const opParameters& p);
54+
static std::filesystem::file_time_type GetGeneratedDialectTimestamp(const opParameters& p);
5555

5656
// is an additional dependency out of date?
5757
// if so update it and return true

opcplusplus/Inc/FileNodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class FileNode : public FileNodeParent
131131
void SaveDependencies(const opString& filepath);
132132
bool LoadDependencies(const opString& filepath);
133133

134-
bool IsDependencyNewer(time_t timestamp);
134+
bool IsDependencyNewer(std::filesystem::file_time_type timestamp);
135135

136136
private:
137137
opSet<opString> Dependencies;

opcplusplus/Inc/Globber.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// Globbing.
1212
///****************************************************************
1313

14-
using boost::filesystem::path;
14+
using filesystem::path;
1515

1616
class Globber
1717
{
@@ -34,7 +34,7 @@ class Globber
3434
ohfilepath(inohfilepath),
3535
oohfilepath(inoohfilepath),
3636
ocppfilepath(inocppfilepath),
37-
ohfilename(inohfilepath.leaf().string())
37+
ohfilename(inohfilepath.filename().string())
3838

3939
{
4040
//ohfilepath = inohfilepath;

opcplusplus/Inc/Paths.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
#pragma once
1818

19-
using namespace boost::filesystem;
19+
//using namespace boost::filesystem;
20+
using namespace filesystem;
2021

2122
inline bool paths_match(const path& a, const path& b)
2223
{
@@ -38,7 +39,7 @@ inline bool paths_match(const path& a, const path& b)
3839

3940
inline path to_relative_path(path p, path basepath)
4041
{
41-
if(p.is_complete())
42+
if(p.is_absolute())
4243
{
4344
//we need to convert this path, since its complete
4445
path workingpath = basepath;
@@ -93,7 +94,7 @@ inline path to_relative_path(path p, path basepath)
9394

9495
inline path to_relative_path(path p)
9596
{
96-
return to_relative_path(p,boost::filesystem::initial_path());
97+
return to_relative_path(p,std::filesystem::current_path());
9798

9899
}
99100

opcplusplus/Inc/Platforms.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
/// Platform-specific stuff.
1212
///****************************************************************
1313

14+
#include <filesystem>
15+
1416
//
1517
// Platform Specific Code Header
1618
//
@@ -22,7 +24,7 @@ class opPlatform
2224
static opString GetOpCppExecutableName();
2325
static opString GetOpCppPath();
2426
static opString GetOpCppDirectory();
25-
static time_t GetOpCppTimeStamp();
27+
static std::filesystem::file_time_type GetOpCppTimeStamp();
2628
static void Assertion();
2729
static void Breakpoint();
2830

opcplusplus/Inc/RegexSupport.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
//so it doesn't need to be compiled so much
1616
//could also accomplish this by adding a static library for it.
1717

18-
#include "../../Lib/boost/boost/xpressive/regex_error.hpp"
18+
//#include "../../Lib/boost/boost/xpressive/regex_error.hpp"
19+
#include <regex>
1920

20-
namespace regex
21+
namespace opregex
2122
{
2223
//may throw boost::xpressive::regex_error
2324
bool Match(const opString& matchstring, const opString& pattern);
@@ -29,6 +30,20 @@ namespace regex
2930
{
3031
return Match(matchstring,pattern);
3132
}
33+
catch (const std::regex_error& regexerror)
34+
{
35+
// regex error 'mismatched parentheses' in pattern '...'
36+
opString error = "regex error, ";
37+
error += "'";
38+
error += regexerror.what();
39+
error += "' in pattern ";
40+
error += "\"";
41+
error += pattern;
42+
error += "\"";
43+
44+
opError::MessageError(node, error);
45+
}
46+
/*
3247
catch(const boost::xpressive::regex_error& regexerror)
3348
{
3449
// regex error 'mismatched parentheses' in pattern '...'
@@ -42,6 +57,7 @@ namespace regex
4257
4358
opError::MessageError(node,error);
4459
}
60+
*/
4561

4662
return false;
4763
}

opcplusplus/Inc/opCPP.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@
2626
#include "opstl.h"
2727

2828
// boost
29-
#include "boost/filesystem/path.hpp"
30-
#include "boost/filesystem/operations.hpp"
31-
#include "boost/filesystem/exception.hpp"
32-
#include "boost/filesystem/convenience.hpp"
33-
#include "boost/filesystem/fstream.hpp"
34-
using boost::filesystem::path;
29+
//#include "boost/filesystem/path.hpp"
30+
//#include "boost/filesystem/operations.hpp"
31+
//#include "boost/filesystem/exception.hpp"
32+
//#include "boost/filesystem/convenience.hpp"
33+
//#include "boost/filesystem/fstream.hpp"
34+
//using boost::filesystem::path;
35+
36+
//filesystem
37+
#include <filesystem>
38+
using filesystem::path;
3539

3640
// md5 stuff..
3741
#include "opmd5.h"

opcplusplus/Inc/opNodeInlines.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3392,17 +3392,17 @@ inline T* FileNode::Load(const opString& file, opScanner::ScanMode scanmode, boo
33923392

33933393
//fix up the inputname
33943394
path filepath = file.GetString();
3395-
filepath.normalize();
3395+
//FIXME: filepath.normalize();
33963396
rootNode->InputName = to_relative_path(filepath).string();
33973397

33983398
path inputpath = rootNode->InputName.GetString();
3399-
rootNode->bAbsolutePath = inputpath.is_complete();
3399+
rootNode->bAbsolutePath = inputpath.is_absolute();
34003400

34013401
//TODO: probably not correct - this is really ugly too.
34023402
if(!rootNode->bAbsolutePath)
34033403
{
3404-
path abspath = initial_path() / rootNode->InputName.GetString();
3405-
abspath.normalize();
3404+
path abspath = std::filesystem::current_path() / rootNode->InputName.GetString();
3405+
//FIXME: abspath.normalize();
34063406

34073407
rootNode->AbsoluteFileName = abspath.string();
34083408
}

opcplusplus/Src/DialectNodes.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ bool CriteriaBodyNode::ValidateOperand(opNode* operand, DialectExpressionMap* ma
662662

663663
pattern = pattern.Substring(1,pattern.Length()-1);
664664

665-
regex::Match("",pattern,valuemod);
665+
opregex::Match("",pattern,valuemod);
666666

667667
return true;
668668
}
@@ -757,7 +757,7 @@ bool CriteriaBodyNode::EvaluateOperand(opNode* operand, ModifierSupportBase* sta
757757

758758
pattern = pattern.Substring(1,pattern.Length()-1);
759759

760-
return regex::Match(modifiervalue,pattern,valuemod);
760+
return opregex::Match(modifiervalue,pattern,valuemod);
761761
}
762762
else if(CriteriaGroupNode* group = node_cast<CriteriaGroupNode>(operand))
763763
{
@@ -855,7 +855,7 @@ void ModifierNodeBase::Validate()
855855

856856
pattern = pattern.Substring(1,pattern.Length()-1);
857857

858-
regex::Match("",pattern,this);
858+
opregex::Match("",pattern,this);
859859
}
860860
}
861861

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy