2020-08-15 04:58:31 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-08-15 04:58:31 -03:00
|
|
|
*/
|
2020-08-17 10:22:30 -03:00
|
|
|
|
2020-08-15 04:58:31 -03:00
|
|
|
#include "CodeDocument.h"
|
|
|
|
|
|
2020-08-17 10:22:30 -03:00
|
|
|
namespace HackStudio {
|
|
|
|
|
|
2020-12-15 07:58:28 -03:00
|
|
|
NonnullRefPtr<CodeDocument> CodeDocument::create(const String& file_path, Client* client)
|
2020-09-26 18:11:15 -03:00
|
|
|
{
|
2021-04-23 11:46:57 -03:00
|
|
|
return adopt_ref(*new CodeDocument(file_path, client));
|
2020-09-26 18:11:15 -03:00
|
|
|
}
|
|
|
|
|
|
2020-08-15 04:58:31 -03:00
|
|
|
NonnullRefPtr<CodeDocument> CodeDocument::create(Client* client)
|
|
|
|
|
{
|
2021-04-23 11:46:57 -03:00
|
|
|
return adopt_ref(*new CodeDocument(client));
|
2020-08-15 04:58:31 -03:00
|
|
|
}
|
2020-08-17 10:22:30 -03:00
|
|
|
|
2020-12-15 07:58:28 -03:00
|
|
|
CodeDocument::CodeDocument(const String& file_path, Client* client)
|
2020-09-26 18:11:15 -03:00
|
|
|
: TextDocument(client)
|
|
|
|
|
, m_file_path(file_path)
|
|
|
|
|
{
|
2021-06-29 11:46:16 -03:00
|
|
|
m_language = language_from_file_extension(LexicalPath::extension(file_path));
|
2021-07-01 21:39:17 -03:00
|
|
|
m_language_name = language_name_from_file_extension(LexicalPath::extension(file_path));
|
2020-09-26 18:11:15 -03:00
|
|
|
}
|
|
|
|
|
|
2020-08-15 04:58:31 -03:00
|
|
|
CodeDocument::CodeDocument(Client* client)
|
|
|
|
|
: TextDocument(client)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CodeDocument::~CodeDocument()
|
|
|
|
|
{
|
|
|
|
|
}
|
2020-08-17 10:22:30 -03:00
|
|
|
|
|
|
|
|
}
|