1234567891011121314151617181920212223242526272829303132333435 |
- //
- // Created by robin on 6/27/15.
- //
-
- #include <string>
- #include "ScBasicCommand.h"
-
- ScBasicCommand::ScBasicCommand(const std::string &data)
- {
- DWORD size = 0;
- for (auto c : data)
- {
- if (isxdigit(c))
- ++size;
- }
- auto d = new BYTE[size];
- size = 0;
- for (int i = 0; i < data.size(); ++i)
- {
- auto c = data[i];
- if (isxdigit(c))
- d[size++] = hexToDec(c);
- }
- _data = ScByteArray(d, size);
- }
-
- ScBasicCommand::~ScBasicCommand()
- {
- }
-
- ScByteArray ScBasicCommand::getData() const
- {
- return _data;
- }
|