1
Fork 0
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:
AnotherTest 2020-11-02 20:20:15 +03:30 committed by Andreas Kling
parent 6e9c6acc87
commit 821e875bc0
3 changed files with 33 additions and 0 deletions

View file

@ -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;
}
};
}