Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
cf6417c9
Commit
cf6417c9
authored
Dec 22, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Opening of single database, not whole env
parent
50e9554c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
23 deletions
+45
-23
wb/lib/wb/src/wb_env.h
wb/lib/wb/src/wb_env.h
+1
-1
wb/lib/wb/src/wb_erep.cpp
wb/lib/wb/src/wb_erep.cpp
+37
-16
wb/lib/wb/src/wb_erep.h
wb/lib/wb/src/wb_erep.h
+2
-2
wb/lib/wb/src/wb_ldh.cpp
wb/lib/wb/src/wb_ldh.cpp
+2
-2
wb/lib/wb/src/wb_ldh.h
wb/lib/wb/src/wb_ldh.h
+2
-1
wb/lib/wb/src/wb_wtt.cpp
wb/lib/wb/src/wb_wtt.cpp
+1
-1
No files found.
wb/lib/wb/src/wb_env.h
View file @
cf6417c9
...
...
@@ -27,7 +27,7 @@ public:
operator
wb_erep
*
()
const
;
bool
operator
==
(
wb_env
&
);
void
load
(
)
{
m_erep
->
load
(
&
m_sts
);}
void
load
(
char
*
db
)
{
m_erep
->
load
(
&
m_sts
,
db
);}
bool
open
();
bool
close
();
...
...
wb/lib/wb/src/wb_erep.cpp
View file @
cf6417c9
...
...
@@ -182,6 +182,8 @@ wb_vrep *wb_erep::nextVolume(pwr_tStatus *sts, pwr_tVid vid)
it
=
m_vrepdbs
.
find
(
vid
);
if
(
it
!=
m_vrepdbs
.
end
())
{
it
++
;
if
(
it
!=
m_vrepdbs
.
end
()
&&
it
->
second
->
duplicateDb
())
it
++
;
if
(
it
!=
m_vrepdbs
.
end
())
{
*
sts
=
LDH__SUCCESS
;
return
it
->
second
;
...
...
@@ -332,7 +334,7 @@ void wb_erep::removeBuffer(pwr_tStatus *sts, wb_vrep *vrep)
return
;
}
void
wb_erep
::
load
(
pwr_tStatus
*
sts
)
void
wb_erep
::
load
(
pwr_tStatus
*
sts
,
char
*
db
)
{
loadDirList
(
sts
);
if
(
EVEN
(
*
sts
))
return
;
...
...
@@ -343,7 +345,7 @@ void wb_erep::load( pwr_tStatus *sts)
*
sts
=
status
;
return
;
}
loadMeta
(
sts
);
loadMeta
(
sts
,
db
);
bindMethods
();
loadLocalWb
(
sts
);
return
;
...
...
@@ -351,7 +353,7 @@ void wb_erep::load( pwr_tStatus *sts)
loadCommonMeta
(
sts
);
if
(
EVEN
(
*
sts
))
return
;
loadMeta
(
sts
);
loadMeta
(
sts
,
db
);
bindMethods
();
loadLocalWb
(
sts
);
}
...
...
@@ -446,7 +448,7 @@ void wb_erep::loadCommonMeta( pwr_tStatus *status)
*
status
=
LDH__SUCCESS
;
}
void
wb_erep
::
loadMeta
(
pwr_tStatus
*
status
)
void
wb_erep
::
loadMeta
(
pwr_tStatus
*
status
,
char
*
db
)
{
// Load local metavolumes
char
found_file
[
200
];
...
...
@@ -553,6 +555,11 @@ void wb_erep::loadMeta( pwr_tStatus *status)
}
else
{
// Load db for this volume
if
(
db
)
{
// If db is specified, load only specified db
if
(
cdh_NoCaseStrcmp
(
vol_array
[
0
],
db
)
!=
0
)
continue
;
}
strcpy
(
vname
,
"$pwrp_db/"
);
strcat
(
vname
,
vol_array
[
0
]);
cdh_ToLower
(
vname
,
vname
);
...
...
@@ -574,22 +581,36 @@ void wb_erep::loadMeta( pwr_tStatus *status)
}
fpm
.
close
();
// Identify dbs that also is loaded as db
vrep_iterator
itdbs
,
itdb
;
for
(
itdbs
=
m_vrepdbs
.
begin
();
itdbs
!=
m_vrepdbs
.
end
();
itdbs
++
)
{
for
(
itdb
=
m_vrepdb
.
begin
();
itdb
!=
m_vrepdb
.
end
();
itdb
++
)
{
if
(
itdbs
->
first
==
itdb
->
first
)
itdbs
->
second
->
setDuplicateDb
(
true
);
}
}
// Load directory volume
strcpy
(
vname
,
"$pwrp_db/directory.db"
);
dcli_translate_filename
(
vname
,
vname
);
if
(
!
db
||
(
db
&&
cdh_NoCaseStrcmp
(
"directory"
,
db
)
==
0
))
{
strcpy
(
vname
,
"$pwrp_db/directory.db"
);
dcli_translate_filename
(
vname
,
vname
);
sts
=
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
ODD
(
sts
))
{
wb_vrepdb
*
vrepdb
=
new
wb_vrepdb
(
this
,
vname
);
vrepdb
->
name
(
"directory"
);
addDb
(
&
sts
,
vrepdb
);
MsgWindow
::
message
(
'I'
,
"Database opened"
,
vname
);
sts
=
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
ODD
(
sts
))
{
wb_vrepdb
*
vrepdb
=
new
wb_vrepdb
(
this
,
vname
);
vrepdb
->
name
(
"directory"
);
addDb
(
&
sts
,
vrepdb
);
MsgWindow
::
message
(
'I'
,
"Database opened"
,
vname
);
}
if
(
EVEN
(
sts
))
{
*
status
=
LDH__PROJCONFIG
;
return
;
}
}
if
(
EVEN
(
sts
))
*
status
=
LDH__PROJCONFIG
;
else
if
(
!
vol_cnt
)
if
(
!
vol_cnt
)
*
status
=
LDH__PROJCONFIG
;
else
*
status
=
LDH__SUCCESS
;
...
...
wb/lib/wb/src/wb_erep.h
View file @
cf6417c9
...
...
@@ -60,7 +60,7 @@ public:
void
removeDbs
(
pwr_tStatus
*
sts
,
wb_vrep
*
vrep
);
void
removeExtern
(
pwr_tStatus
*
sts
,
wb_vrep
*
vrep
);
void
removeBuffer
(
pwr_tStatus
*
sts
,
wb_vrep
*
vrep
);
void
load
(
pwr_tStatus
*
sts
);
void
load
(
pwr_tStatus
*
sts
,
char
*
db
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
wb_name
&
name
);
...
...
@@ -74,7 +74,7 @@ public:
private:
void
loadDirList
(
pwr_tStatus
*
status
);
void
loadCommonMeta
(
pwr_tStatus
*
status
);
void
loadMeta
(
pwr_tStatus
*
status
);
void
loadMeta
(
pwr_tStatus
*
status
,
char
*
db
);
void
loadLocalWb
(
pwr_tStatus
*
sts
);
void
bindMethods
();
};
...
...
wb/lib/wb/src/wb_ldh.cpp
View file @
cf6417c9
...
...
@@ -1143,11 +1143,11 @@ ldh_OpenSession(ldh_tSession *session, ldh_tVolume volume,
it with objects from database on disk. */
pwr_tStatus
ldh_OpenWB
(
ldh_tWorkbench
*
workbench
)
ldh_OpenWB
(
ldh_tWorkbench
*
workbench
,
char
*
db
)
{
wb_erep
*
erep
=
new
wb_erep
();
wb_env
*
env
=
new
wb_env
(
erep
);
env
->
load
();
env
->
load
(
db
);
*
workbench
=
(
ldh_tWorkbench
)
env
;
return
env
->
sts
();
...
...
wb/lib/wb/src/wb_ldh.h
View file @
cf6417c9
...
...
@@ -804,7 +804,8 @@ ldh_OpenSession (
pwr_tStatus
ldh_OpenWB
(
ldh_tWorkbench
*
WorkBench
ldh_tWorkbench
*
WorkBench
,
char
*
db
);
pwr_tStatus
ldh_Paste
(
...
...
wb/lib/wb/src/wb_wtt.cpp
View file @
cf6417c9
...
...
@@ -1218,7 +1218,7 @@ static int wtt_get_wbctx( void *ctx, ldh_tWBContext *wbctx)
else
{
wtt
->
set_clock_cursor
();
sts
=
ldh_OpenWB
(
&
wtt
->
wbctx
);
sts
=
ldh_OpenWB
(
&
wtt
->
wbctx
,
0
);
if
(
ODD
(
sts
))
*
wbctx
=
wtt
->
wbctx
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment