Skip to content

Commit

Permalink
libdeng2|Block: Constructor from a null terminated C-string
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 27, 2013
1 parent c11e4a3 commit f2730ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions doomsday/libdeng2/include/de/data/block.h
Expand Up @@ -41,6 +41,7 @@ class DENG2_PUBLIC Block : public QByteArray, public IByteArray, public IBlock
Block(IByteArray const &array);
Block(Block const &other);
Block(QByteArray const &byteArray);
Block(char const *nullTerminatedCStr);
Block(void const *data, Size length);

/**
Expand Down
4 changes: 4 additions & 0 deletions doomsday/libdeng2/src/data/block.cpp
Expand Up @@ -42,6 +42,10 @@ Block::Block(QByteArray const &byteArray)
: QByteArray(byteArray)
{}

Block::Block(char const *nullTerminatedCStr)
: QByteArray(nullTerminatedCStr)
{}

Block::Block(void const *data, Size length)
: QByteArray(reinterpret_cast<char const *>(data), length), IByteArray(), IBlock()
{}
Expand Down

0 comments on commit f2730ca

Please sign in to comment.