Add const char* overrides for some methods to avoid string copies
commit3e802ddaf5f831199b169ca1d177feaddd6b5094
authorChris Robinson <chris.kcat@gmail.com>
Mon, 16 Oct 2017 16:58:06 +0000 (16 09:58 -0700)
committerChris Robinson <chris.kcat@gmail.com>
Mon, 16 Oct 2017 16:58:06 +0000 (16 09:58 -0700)
treee5abbcbb0bcc0fb3237bdb4aeef8b17746987dd8
parent83ab645ab7f40d7f30025f42f3ebe5529b1744f6
Add const char* overrides for some methods to avoid string copies

Although the StringView itself doesn't copy strings, it can't guarantee the
string it's providing a view to is null-terminated. OpenAL, being a C API,
requires null-terminated char arrays for strings. Consequently, the StringView
needs to be copied into a temporary String whose c_str() method can provide the
necessary C-style string. This extra copying is needlessly wasteful if the
input was initially a C-style string to begin with.
include/AL/alure2.h
src/device.cpp
src/device.h
src/devicemanager.cpp
src/devicemanager.h