mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 17:30:35 +05:00
Allow EDF URL style
This commit is contained in:
parent
db3a0bbde4
commit
bd19f3d315
@ -197,6 +197,7 @@ namespace
|
|||||||
|
|
||||||
bool isURL( LibraryFile & libraryFile )
|
bool isURL( LibraryFile & libraryFile )
|
||||||
{
|
{
|
||||||
|
{// round1
|
||||||
enum { SCHEME = 2, AUTHORITY = 4, PATH = 5 }; // sub-strings
|
enum { SCHEME = 2, AUTHORITY = 4, PATH = 5 }; // sub-strings
|
||||||
std::regex urlRegex ( R"(^(([^:\/?#]+):)?(//([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?)",
|
std::regex urlRegex ( R"(^(([^:\/?#]+):)?(//([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?)",
|
||||||
std::regex::extended );
|
std::regex::extended );
|
||||||
@ -207,7 +208,21 @@ namespace
|
|||||||
libraryFile._isURL = ( !matchResult.str( SCHEME ).empty() &&
|
libraryFile._isURL = ( !matchResult.str( SCHEME ).empty() &&
|
||||||
!matchResult.str( AUTHORITY ).empty() &&
|
!matchResult.str( AUTHORITY ).empty() &&
|
||||||
!matchResult.str( PATH ).empty() );
|
!matchResult.str( PATH ).empty() );
|
||||||
|
}
|
||||||
|
if(libraryFile._isURL)
|
||||||
|
return true;
|
||||||
|
{// round2
|
||||||
|
enum { HOST = 2, PORT = 3, PATH = 4 }; // sub-strings
|
||||||
|
std::regex urlRegex ( R"(^(([^:\/?#]+):)?([^/]+)?(/[^#]*))",
|
||||||
|
std::regex::extended );
|
||||||
|
std::smatch matchResult;
|
||||||
|
|
||||||
|
libraryFile._isURL = false;
|
||||||
|
if ( std::regex_match( libraryFile._name, matchResult, urlRegex ))
|
||||||
|
libraryFile._isURL = ( !matchResult.str( HOST ).empty() &&
|
||||||
|
!matchResult.str( PORT ).empty() &&
|
||||||
|
!matchResult.str( PATH ).empty() );
|
||||||
|
}
|
||||||
return libraryFile._isURL;
|
return libraryFile._isURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user