Rev 1642 | Rev 1952 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1642 | Rev 1916 | ||
|---|---|---|---|
| Line 45... | Line 45... | ||
| 45 | } |
45 | } |
| 46 | 46 | ||
| 47 | Byteset::Byteset(std::string str) |
47 | Byteset::Byteset(std::string str) |
| 48 | { |
48 | { |
| 49 | this->max_size_ = str.size() + 1; |
49 | this->max_size_ = str.size() + 1; |
| - | 50 | this->size_ = this->max_size_; |
|
| - | 51 | this->bytes_ = new unsigned char[this->max_size_]; |
|
| - | 52 | ||
| - | 53 | memcpy(this->bytes_, str.data(), this->max_size_); |
|
| - | 54 | } |
|
| - | 55 | ||
| - | 56 | Byteset::Byteset(std::string str, bool no_null_termination) |
|
| - | 57 | { |
|
| - | 58 | this->max_size_ = str.size() + (no_null_termination ? 0 : 1); |
|
| 50 | this->size_ = this->max_size_; |
59 | this->size_ = this->max_size_; |
| 51 | this->bytes_ = new unsigned char[this->max_size_]; |
60 | this->bytes_ = new unsigned char[this->max_size_]; |
| 52 | 61 | ||
| 53 | memcpy(this->bytes_, str.data(), this->max_size_); |
62 | memcpy(this->bytes_, str.data(), this->max_size_); |
| 54 | } |
63 | } |