mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:27:44 +00:00
Spreadsheet: Serialise Positions to URLs and add Sheet::from_uri()
This commit is contained in:
parent
6e9c6acc87
commit
821e875bc0
3 changed files with 33 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/URL.h>
|
||||
|
||||
namespace Spreadsheet {
|
||||
|
||||
|
@ -44,6 +45,16 @@ struct Position {
|
|||
{
|
||||
return !(other == *this);
|
||||
}
|
||||
|
||||
URL to_url() const
|
||||
{
|
||||
URL url;
|
||||
url.set_protocol("spreadsheet");
|
||||
url.set_host("cell");
|
||||
url.set_path(String::formatted("/{}", getpid()));
|
||||
url.set_fragment(String::formatted("{}{}", column, row));
|
||||
return url;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue