Renamed Aegilib to Gorgonsub.

Originally committed to SVN as r2047.
This commit is contained in:
Rodrigo Braz Monteiro 2008-03-13 21:28:22 +00:00
parent 72145e8fa8
commit bb425f8a86
47 changed files with 196 additions and 214 deletions

View file

@ -160,18 +160,6 @@
RelativePath=".\include\aegilib\action.h"
>
</File>
<File
RelativePath=".\include\aegilib\aegilib.h"
>
</File>
<File
RelativePath=".\include\aegilib\aegistring.h"
>
</File>
<File
RelativePath=".\include\aegilib\aegitime.h"
>
</File>
<File
RelativePath=".\include\aegilib\colour.h"
>
@ -196,6 +184,18 @@
RelativePath=".\include\aegilib\format_manager.h"
>
</File>
<File
RelativePath=".\include\aegilib\gorgonstring.h"
>
</File>
<File
RelativePath=".\include\aegilib\gorgonsub.h"
>
</File>
<File
RelativePath=".\include\aegilib\gorgontime.h"
>
</File>
<File
RelativePath=".\include\aegilib\manipulator.h"
>

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -35,7 +35,7 @@
#pragma once
namespace Aegilib {
namespace Gorgonsub {
// The different types of actions available
enum ActionType {
ACTION_INSERT,

View file

@ -27,16 +27,16 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
namespace Aegilib {
namespace Gorgonsub {
// Colour class
class Colour {

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -35,10 +35,10 @@
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
#include <exception>
namespace Aegilib {
namespace Gorgonsub {
// Exception class
class Exception : public std::exception {

View file

@ -1,59 +0,0 @@
// Copyright (c) 2008, Rodrigo Braz Monteiro
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
namespace Aegilib {
// File reader interface
class FileReader {
public:
virtual ~FileReader() {}
virtual String ReadLineFromFile() = 0;
virtual bool HasMoreLines() = 0;
virtual String GetCurrentEncoding() = 0;
};
// File writer interface
class FileWriter {
public:
virtual ~FileWriter() {}
virtual void WriteLineToFile(String line,bool addLineBreak=true) = 0;
};
};

View file

@ -27,17 +27,17 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
#include "tr1.h"
namespace Aegilib {
namespace Gorgonsub {
// Prototypes
class FormatHandler;
class Model;

View file

@ -27,17 +27,17 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
#include "tr1.h"
namespace Aegilib {
namespace Gorgonsub {
// Format handler interface
class FormatHandler {

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -36,7 +36,7 @@
#pragma once
#include "format.h"
namespace Aegilib {
namespace Gorgonsub {
// Format manager class
class FormatManager {

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -38,7 +38,7 @@
#include <wx/string.h>
#include <vector>
namespace Aegilib {
namespace Gorgonsub {
// Define the string type used throughout this library
//typedef std::basic_string<wchar_t> String;

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -40,7 +40,7 @@
#include "view.h"
#include "controller.h"
#include "notification.h"
#include "aegistring.h"
#include "gorgonstring.h"
#include "format.h"
#include "format_handler.h"
#include "format_manager.h"
@ -48,7 +48,7 @@
#include "section.h"
#include "section_entry_dialogue.h"
#include "section_entry_style.h"
#include "aegitime.h"
#include "gorgontime.h"
#include "colour.h"
#include "utils.h"
#include "version.h"

View file

@ -27,16 +27,16 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
namespace Aegilib {
namespace Gorgonsub {
// Time class
class Time {

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -36,9 +36,9 @@
#pragma once
#include <list>
#include "action.h"
#include "aegistring.h"
#include "gorgonstring.h"
namespace Aegilib {
namespace Gorgonsub {
// Manipulator class
class Manipulator {

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -40,7 +40,7 @@
#include "manipulator.h"
#include "section.h"
namespace Aegilib {
namespace Gorgonsub {
// Prototypes
class View;
@ -71,6 +71,7 @@ namespace Aegilib {
const Format& GetFormat() const;
void AddListener(ViewPtr listener);
void Clear();
void Load(wxInputStream &input,const FormatPtr format=FormatPtr(),const String encoding=L"");
void Save(wxOutputStream &output,const FormatPtr format=FormatPtr(),const String encoding=L"UTF-8");
void LoadFile(const String filename,const String encoding=L"");

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -38,7 +38,7 @@
#include "model.h"
#include "notification.h"
namespace Aegilib {
namespace Gorgonsub {
// Notification class
class Notification {

View file

@ -27,20 +27,20 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
#include "section_entry.h"
#include "tr1.h"
#include <list>
#include <map>
namespace Aegilib {
namespace Gorgonsub {
// Section class
class Section {

View file

@ -27,17 +27,17 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
#include "tr1.h"
namespace Aegilib {
namespace Gorgonsub {
// Types
enum SectionEntryType {
@ -84,4 +84,13 @@ namespace Aegilib {
static const SectionEntryRawPtr GetAsRaw(const SectionEntryPtr &ptr);
};
// Section plain-text entry
class SectionEntryPlain : public SectionEntry {
public:
SectionEntryType GetType() const { return SECTION_ENTRY_PLAIN; }
virtual ~SectionEntryPlain() {}
virtual String GetText() const =0;
virtual void SetText(const String &_data) =0;
};
};

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -36,11 +36,11 @@
#pragma once
#include "exception.h"
#include "aegitime.h"
#include "gorgontime.h"
#include "section_entry.h"
namespace Aegilib {
namespace Gorgonsub {
// Dialogue class
class SectionEntryDialogue : public SectionEntry {

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -40,7 +40,7 @@
#include "section_entry.h"
namespace Aegilib {
namespace Gorgonsub {
// Style class
class SectionEntryStyle : public SectionEntry {

View file

@ -27,20 +27,20 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
#include "tr1.h"
// Prototypes
class wxStringTokenizer;
namespace Aegilib {
namespace Gorgonsub {
// Tokenizer class
class Tokenizer {

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -42,7 +42,7 @@
#include <tr1/memory>
#include <tr1/array>
namespace Aegilib {
namespace Gorgonsub {
using std::tr1::shared_ptr;
using std::tr1::weak_ptr;
using std::tr1::array;

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -35,7 +35,7 @@
#pragma once
#include "aegilib.h"
#include "Gorgonsub.h"
/////////////
@ -67,7 +67,7 @@ T Mid(T a,T b,T c)
////////////////////
// Helper functions
namespace Aegilib {
namespace Gorgonsub {
// Convert a string to an integer
int StringToInt(const String &str);

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -35,11 +35,11 @@
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
////////////////////
// Helper functions
namespace Aegilib {
namespace Gorgonsub {
// Version
String GetLibraryName();

View file

@ -27,17 +27,17 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#pragma once
#include "aegistring.h"
#include "gorgonstring.h"
#include <list>
namespace Aegilib {
namespace Gorgonsub {
// Prototypes
class Model;
class Notification;

View file

@ -27,14 +27,14 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#include "action.h"
using namespace Aegilib;
using namespace Gorgonsub;
///////////////////////

View file

@ -27,15 +27,15 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#include "aegilib.h"
using namespace Aegilib;
#include "Gorgonsub.h"
using namespace Gorgonsub;
////////////////

View file

@ -27,14 +27,14 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#include "exception.h"
using namespace Aegilib;
using namespace Gorgonsub;
///////////////

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -36,7 +36,7 @@
#include "format_manager.h"
#include "formats/format_ass.h"
#include <wx/string.h>
using namespace Aegilib;
using namespace Gorgonsub;
////////

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -41,7 +41,7 @@
#include "../text_file_writer.h"
#include <iostream>
#include <wx/tokenzr.h>
using namespace Aegilib;
using namespace Gorgonsub;
///////
@ -118,6 +118,7 @@ void FormatHandlerASS::Load(wxInputStream &file,const String encoding)
while (reader.HasMoreLines()) {
// Read a line
wxString cur = reader.ReadLineFromFile();
if (cur.IsEmpty()) continue;
// Process group
prevGroup = curGroup;
@ -188,7 +189,7 @@ SectionEntryPtr FormatHandlerASS::MakeEntry(const String &data,SectionPtr sectio
// Attachments
if (group == _T("Fonts") || group == _T("Graphics")) {
// TODO
final = shared_ptr<PlainASS>(new PlainASS(data));
}
// Events
@ -206,7 +207,7 @@ SectionEntryPtr FormatHandlerASS::MakeEntry(const String &data,SectionPtr sectio
// Garbage/hard comments
else {
// TODO
final = shared_ptr<PlainASS>(new PlainASS(data));
}
}
@ -237,6 +238,11 @@ SectionEntryPtr FormatHandlerASS::MakeEntry(const String &data,SectionPtr sectio
return SectionEntryPtr();
}
// Unknown group, just leave it intact
else {
final = shared_ptr<PlainASS>(new PlainASS(data));
}
// Return entry
return final;
}

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -41,7 +41,7 @@
#include "section_entry_style.h"
#include "tr1.h"
namespace Aegilib {
namespace Gorgonsub {
// Prototypes
class Model;
@ -205,4 +205,18 @@ namespace Aegilib {
int GetMargin(int n) const { return margin.at(n); }
};
// Raw line
class PlainASS : public SectionEntryPlain, public SerializeText {
private:
String data;
String ToText(int param) const { (void)param; return data; }
public:
PlainASS();
PlainASS(String _data) : data(_data) {}
String GetText() const { return data; }
void SetText(const String &_data) { data = _data; }
};
};

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -36,7 +36,7 @@
#include "format_ass.h"
#include "tokenizer.h"
#include "utils.h"
using namespace Aegilib;
using namespace Gorgonsub;
////////////////

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -36,7 +36,7 @@
#include "format_ass.h"
#include "tokenizer.h"
#include "utils.h"
using namespace Aegilib;
using namespace Gorgonsub;
////////////////

View file

@ -27,14 +27,14 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#include "aegilib.h"
using namespace Aegilib;
#include "Gorgonsub.h"
using namespace Gorgonsub;
///////////////

View file

@ -27,14 +27,14 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#include "aegilib.h"
using namespace Aegilib;
#include "Gorgonsub.h"
using namespace Gorgonsub;
/////////////////////////////////////////////////////////
@ -89,7 +89,7 @@ Manipulator Model::CreateAntiManipulator(const Manipulator &src)
void Model::Load(wxInputStream &input,const FormatPtr format,const String encoding)
{
// Autodetect format
if (format == NULL) {
if (!format) {
// TODO
// No format found
@ -100,6 +100,9 @@ void Model::Load(wxInputStream &input,const FormatPtr format,const String encodi
FormatHandlerPtr handler = format->GetHandler(*this);
if (!handler) throw Exception(Exception::No_Format_Handler);
// Clear the model first
Clear();
// Load
handler->Load(input,encoding);
}
@ -110,7 +113,7 @@ void Model::Load(wxInputStream &input,const FormatPtr format,const String encodi
void Model::Save(wxOutputStream &output,const FormatPtr format,const String encoding)
{
// Autodetect format
if (format == NULL) {
if (!format) {
// TODO
// No format found
@ -182,3 +185,13 @@ size_t Model::GetSectionCount() const
{
return sections.size();
}
//////////
// Clear
void Model::Clear()
{
sections.clear();
undoStack.clear();
redoStack.clear();
}

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -35,7 +35,7 @@
#include "section.h"
using namespace Aegilib;
using namespace Gorgonsub;
///////////////

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -37,7 +37,7 @@
#include "section_entry.h"
#include "section_entry_dialogue.h"
#include "section_entry_style.h"
using namespace Aegilib;
using namespace Gorgonsub;
/////////////////////////////////

View file

@ -40,7 +40,7 @@
#include <string>
#include <wx/wfstream.h>
#include "text_file_reader.h"
using namespace Aegilib;
using namespace Gorgonsub;
#ifdef WITH_UNIVCHARDET
#include "charset_detect.h"
@ -49,7 +49,7 @@ using namespace Aegilib;
///////////////
// Constructor
TextFileReader::TextFileReader(wxInputStream &stream,Aegilib::String enc,bool _trim)
TextFileReader::TextFileReader(wxInputStream &stream,Gorgonsub::String enc,bool _trim)
: file(stream)
{
// Setup
@ -99,7 +99,7 @@ void TextFileReader::SetEncodingConfiguration() {
//////////////////////////
// Reads a line from file
Aegilib::String TextFileReader::ReadLineFromFile() {
Gorgonsub::String TextFileReader::ReadLineFromFile() {
wxString wxbuffer;
size_t bufAlloc = 1024;
wxbuffer.Alloc(bufAlloc);
@ -169,7 +169,7 @@ Aegilib::String TextFileReader::ReadLineFromFile() {
wxbuffer.Trim(true);
wxbuffer.Trim(false);
}
return Aegilib::String(wxbuffer.c_str());
return Gorgonsub::String(wxbuffer.c_str());
}
@ -182,7 +182,7 @@ bool TextFileReader::HasMoreLines() {
////////////////////////////////
// Ensure that charset is valid
void TextFileReader::EnsureValid(Aegilib::String enc) {
void TextFileReader::EnsureValid(Gorgonsub::String enc) {
if (enc == _T("unknown") || enc == _T("UTF-32BE") || enc == _T("UTF-32LE")) {
wxString error = _T("Character set ");
error += enc;
@ -194,6 +194,6 @@ void TextFileReader::EnsureValid(Aegilib::String enc) {
///////////////////////////
// Get encoding being used
Aegilib::String TextFileReader::GetCurrentEncoding() {
Gorgonsub::String TextFileReader::GetCurrentEncoding() {
return encoding.c_str();
}

View file

@ -38,11 +38,11 @@
// Headers
#include "aegilib.h"
#include "Gorgonsub.h"
#include <wx/stream.h>
namespace Aegilib {
namespace Gorgonsub {
class TextFileReader {
private:
wxString encoding;

View file

@ -38,7 +38,7 @@
// Headers
#include <fstream>
#include "text_file_writer.h"
using namespace Aegilib;
using namespace Gorgonsub;
///////////////
@ -60,7 +60,7 @@ TextFileWriter::~TextFileWriter() {
/////////////////
// Write to file
void TextFileWriter::WriteLineToFile(Aegilib::String line,bool addLineBreak) {
void TextFileWriter::WriteLineToFile(Gorgonsub::String line,bool addLineBreak) {
// Add line break
wxString temp = line;
if (addLineBreak) temp += _T("\r\n");

View file

@ -35,11 +35,11 @@
#pragma once
#include "aegilib.h"
#include "Gorgonsub.h"
#include <wx/stream.h>
namespace Aegilib {
namespace Gorgonsub {
class TextFileWriter {
private:
wxString encoding;
@ -56,6 +56,6 @@ namespace Aegilib {
TextFileWriter(wxOutputStream &stream,String encoding=_T(""));
~TextFileWriter();
void WriteLineToFile(Aegilib::String line,bool addLineBreak=true);
void WriteLineToFile(Gorgonsub::String line,bool addLineBreak=true);
};
};

View file

@ -27,14 +27,14 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#include "aegilib.h"
using namespace Aegilib;
#include "Gorgonsub.h"
using namespace Gorgonsub;
//////////////////////

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -36,7 +36,7 @@
#include "tokenizer.h"
#include "exception.h"
#include <wx/tokenzr.h>
using namespace Aegilib;
using namespace Gorgonsub;
///////////////
// Constructor

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -35,12 +35,12 @@
#include "utils.h"
using namespace Aegilib;
using namespace Gorgonsub;
//////////////////////////////////
// Convert a string to an integer
int Aegilib::StringToInt(const String &str)
int Gorgonsub::StringToInt(const String &str)
{
if (!str.IsNumber()) return 0;
long temp;
@ -51,7 +51,7 @@ int Aegilib::StringToInt(const String &str)
////////////////
// Pretty float
String Aegilib::PrettyFloat(String src) {
String Gorgonsub::PrettyFloat(String src) {
if (src.Contains(_T("."))) {
size_t len = src.Length();
while (src.Right(1) == _T("0")) {
@ -66,19 +66,19 @@ String Aegilib::PrettyFloat(String src) {
return src;
}
String Aegilib::PrettyFloatF(float src) { return Aegilib::PrettyFloat(wxString::Format(_T("%f"),src)); }
String Aegilib::PrettyFloatD(double src) { return Aegilib::PrettyFloat(wxString::Format(_T("%f"),src)); }
String Gorgonsub::PrettyFloatF(float src) { return Gorgonsub::PrettyFloat(wxString::Format(_T("%f"),src)); }
String Gorgonsub::PrettyFloatD(double src) { return Gorgonsub::PrettyFloat(wxString::Format(_T("%f"),src)); }
///////////////////
// Float to string
String Aegilib::FloatToString(double value) {
String Gorgonsub::FloatToString(double value) {
return PrettyFloat(wxString::Format(_T("%f"),value));
}
/////////////////
// Int to string
String Aegilib::IntegerToString(int value) {
String Gorgonsub::IntegerToString(int value) {
return wxString::Format(_T("%i"),value);
}

View file

@ -27,7 +27,7 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
@ -35,21 +35,21 @@
#include "version.h"
#include "aegistring.h"
using namespace Aegilib;
#include "gorgonstring.h"
using namespace Gorgonsub;
////////////////
// Library data
String Aegilib::GetLibraryName()
String Gorgonsub::GetLibraryName()
{
return _T("Aegilib");
return _T("Gorgonsub");
}
String Aegilib::GetLibraryVersionString()
String Gorgonsub::GetLibraryVersionString()
{
return _T("Aegilib v0.x - EXPERIMENTAL");
return _T("Gorgonsub v0.x - EXPERIMENTAL");
}
String Aegilib::GetLibraryURL()
String Gorgonsub::GetLibraryURL()
{
return _T("http://www.aegisub.net");
}
@ -60,22 +60,22 @@ String Aegilib::GetLibraryURL()
static String* hostName = NULL;
static String* hostURL = NULL;
void Aegilib::SetHostApplicationName(const String name)
void Gorgonsub::SetHostApplicationName(const String name)
{
if (!hostName) hostName = new String();
*hostName = name;
}
void Aegilib::SetHostApplicationURL(const String url)
void Gorgonsub::SetHostApplicationURL(const String url)
{
if (!hostURL) hostURL = new String();
*hostURL = url;
}
String Aegilib::GetHostApplicationName()
String Gorgonsub::GetHostApplicationName()
{
if (hostName) return *hostName;
return L"unknown application";
}
String Aegilib::GetHostApplicationURL()
String Gorgonsub::GetHostApplicationURL()
{
if (hostURL) return *hostURL;
return L"";

View file

@ -27,14 +27,14 @@
//
// -----------------------------------------------------------------------------
//
// AEGISUB/AEGILIB
// AEGISUB/GORGONSUB
//
// Website: http://www.aegisub.net
// Contact: mailto:amz@aegisub.net
//
#include "aegilib.h"
using namespace Aegilib;
#include "Gorgonsub.h"
using namespace Gorgonsub;
void View::Register(Model &model)
{

View file

@ -33,7 +33,7 @@
// Contact: mailto:amz@aegisub.net
//
#include <aegilib/aegilib.h>
#include <aegilib/gorgonsub.h>
#include <wx/wfstream.h>
#include <iostream>
#include "text_file_reader.h"
@ -41,14 +41,14 @@
int main () {
using namespace std;
using namespace Aegilib;
using namespace Gorgonsub;
cout << "Aegilib test program by amz.\n\n";
cout << "Gorgonsub test program by amz.\n\n";
try {
// Set up the lib
FormatManager::InitializeFormats();
Aegilib::SetHostApplicationName(L"Aegilib test program");
Gorgonsub::SetHostApplicationName(L"Aegilib test program");
// Subtitles model
Model subs;

View file

@ -39,7 +39,6 @@
///////////
// Headers
#include <aegilib/file.h>
#include <wx/wxprec.h>
#include <wx/dynarray.h>
#include <wx/string.h>
@ -52,7 +51,7 @@
/////////
// Class
class TextFileReader : public Aegilib::FileReader {
class TextFileReader {
private:
wxString filename;
wxString encoding;
@ -73,15 +72,15 @@ private:
void SetEncodingConfiguration();
public:
TextFileReader(Aegilib::String filename,Aegilib::String encoding=_T(""),bool trim=true);
TextFileReader(Gorgonsub::String filename,Gorgonsub::String encoding=_T(""),bool trim=true);
~TextFileReader();
Aegilib::String ReadLineFromFile();
Gorgonsub::String ReadLineFromFile();
bool HasMoreLines();
static void EnsureValid(const Aegilib::String encoding);
Aegilib::String GetCurrentEncoding();
static Aegilib::String GetEncoding(const Aegilib::String filename);
static void EnsureValid(const Gorgonsub::String encoding);
Gorgonsub::String GetCurrentEncoding();
static Gorgonsub::String GetEncoding(const Gorgonsub::String filename);
};

View file

@ -40,7 +40,6 @@
///////////
// Headers
#include <aegilib/file.h>
#include <wx/wxprec.h>
#include <wx/string.h>
#include <fstream>
@ -48,7 +47,7 @@
/////////
// Class
class TextFileWriter : public Aegilib::FileWriter {
class TextFileWriter {
private:
wxString filename;
wxString encoding;
@ -66,10 +65,10 @@ private:
void SetEncoding();
public:
TextFileWriter(Aegilib::String filename,Aegilib::String encoding=_T(""));
TextFileWriter(Gorgonsub::String filename,Gorgonsub::String encoding=_T(""));
~TextFileWriter();
void WriteLineToFile(Aegilib::String line,bool addLineBreak=true);
void WriteLineToFile(Gorgonsub::String line,bool addLineBreak=true);
};