Numworks Epsilon  1.4.1
Graphing Calculator Operating System
string_descriptor.cpp
Go to the documentation of this file.
1 #include "string_descriptor.h"
2 #include <string.h>
3 
4 namespace Ion {
5 namespace USB {
6 namespace Device {
7 
10  const char * stringPointer = m_string;
11  while (*stringPointer != 0) {
12  uint16_t stringAsUTF16CodePoint = *stringPointer;
13  c->push(stringAsUTF16CodePoint);
14  stringPointer++;
15  }
16 }
17 
19  // The script is returned in UTF-16, hence the multiplication.
20  return Descriptor::bLength() + 2*strlen(m_string);
21 }
22 
23 }
24 }
25 }
virtual uint8_t bLength() const override
unsigned short uint16_t
Definition: stdint.h:5
unsigned char uint8_t
Definition: stdint.h:4
c(generic_all_nodes)
void push(Channel *c) const override
void push(Channel *c) const override
Definition: descriptor.cpp:8
size_t strlen(const char *s)
Definition: strlen.c:3
Definition: app.cpp:5
Definition: backlight.h:6
virtual uint8_t bLength() const
Definition: descriptor.h:22