~frankencode/drycore/trunk

« back to all changes in this revision

Viewing changes to dry/String.cpp

  • Committer: Frank Mertens
  • Date: 2013-02-27 18:43:50 UTC
  • Revision ID: frank@cyblogic.de-20130227184350-ypu14rj5e2r8gwqz
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 /*
 
2
  * Copyright (C) 2007-2013 Frank Mertens.
 
3
  *
 
4
  * This program is free software; you can redistribute it and/or
 
5
  * modify it under the terms of the GNU General Public License
 
6
  * as published by the Free Software Foundation; either version
 
7
  * 2 of the License, or (at your option) any later version.
 
8
  */
 
9
 
 
10
#include "Format.hpp"
 
11
#include "Variant.hpp"
 
12
#include "String.hpp"
 
13
 
 
14
namespace dry
 
15
{
 
16
 
 
17
String::String(const Variant &b)
 
18
        : Super(cast<ByteArray>(b))
 
19
{
 
20
        if (!Super::get()) Super::set(ByteArray::empty());
 
21
}
 
22
 
 
23
String::String(const Format &b)
 
24
{
 
25
        *this = *ByteArray::join(b);
 
26
}
 
27
 
 
28
String::String(Ref<StringList> parts) { *this = join(parts); }
 
29
 
 
30
} // namespace dry