Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netrunner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Odilitime
netrunner
Commits
514fc965
Commit
514fc965
authored
7 years ago
by
Odilitime
Browse files
Options
Downloads
Patches
Plain Diff
print(), pointInHistory draft, notes
parent
51cdc564
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/BrowsingHistory.cpp
+8
-0
8 additions, 0 deletions
src/BrowsingHistory.cpp
src/BrowsingHistory.h
+14
-2
14 additions, 2 deletions
src/BrowsingHistory.h
with
22 additions
and
2 deletions
src/BrowsingHistory.cpp
+
8
−
0
View file @
514fc965
...
...
@@ -50,3 +50,11 @@ void BrowsingHistory::replaceState(void* stateObj, std::string const& title, URL
}
*
currentPosition
=
(
*
currentPosition
).
merge
(
url
);
}
void
BrowsingHistory
::
print
()
{
int
i
=
0
;
for
(
std
::
vector
<
URL
>::
iterator
it
=
history
.
begin
();
it
!=
history
.
end
();
++
it
)
{
std
::
cout
<<
"BrowsingHistory::print "
<<
i
<<
": "
<<
it
->
toString
()
<<
std
::
endl
;
i
++
;
}
}
This diff is collapsed.
Click to expand it.
src/BrowsingHistory.h
+
14
−
2
View file @
514fc965
...
...
@@ -5,6 +5,13 @@
#include
"URL.h"
#include
<functional>
struct
pointInHistory
{
URL
realURL
;
URL
displayURL
;
std
::
string
title
;
void
*
stateObj
;
// limit of 640k here
};
/*
NOTE: The first parameter of the constructor is the callback to be called when
calling go(int) (or back or forward or whatever). Should be a
...
...
@@ -28,11 +35,16 @@ public:
// stateObj: void* should be a Javascript object once we have those. Just
// give it nullptr for the time being.
// title: "Firefox currently ignores this parameter, although it may
// use it in the future.". So i guess we ignore it too?
// use it in the future.". So i guess we ignore it too?
well we'll make plans to properly use it.
void
pushState
(
void
*
stateObj
,
std
::
string
const
&
title
,
URL
const
&
url
);
void
replaceState
(
void
*
stateObj
,
std
::
string
const
&
title
,
URL
const
&
url
);
// onGotoPage can call onPopState... or maybe it should be renamed?
// onPopState <- call when fwd/bck are used and sends the state associated with that point in history
void
print
();
private:
// push overrides the real URL with a display URL, we'll need to store both
// also need to store a state
std
::
vector
<
URL
>
history
;
std
::
vector
<
URL
>::
iterator
currentPosition
;
std
::
function
<
void
(
URL
const
&
)
>
onGotoPage
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment