mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Cleanup.
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
#ifndef BX_COMMANDLINE_H_HEADER_GUARD
|
||||
#define BX_COMMANDLINE_H_HEADER_GUARD
|
||||
|
||||
#include "bx.h"
|
||||
#include "string.h"
|
||||
|
||||
namespace bx
|
||||
{
|
||||
/// Reference:
|
||||
/// http://msdn.microsoft.com/en-us/library/a1y7w461.aspx
|
||||
const char* tokenizeCommandLine(const char* _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term = '\0');
|
||||
const char* tokenizeCommandLine(const StringView& _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term = '\0');
|
||||
|
||||
///
|
||||
class CommandLine
|
||||
|
||||
@@ -12,10 +12,11 @@ namespace bx
|
||||
// Reference:
|
||||
// - https://web.archive.org/web/20180629044234/https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
|
||||
//
|
||||
const char* tokenizeCommandLine(const char* _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term)
|
||||
const char* tokenizeCommandLine(const StringView& _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term)
|
||||
{
|
||||
int32_t argc = 0;
|
||||
const char* curr = _commandLine;
|
||||
const char* curr = _commandLine.getPtr();
|
||||
const char* end = _commandLine.getTerm();
|
||||
char* currOut = _buffer;
|
||||
char term = ' ';
|
||||
bool sub = false;
|
||||
@@ -31,7 +32,7 @@ namespace bx
|
||||
|
||||
ParserState state = SkipWhitespace;
|
||||
|
||||
while ('\0' != *curr
|
||||
while (end != curr
|
||||
&& _term != *curr
|
||||
&& argc < _maxArgvs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user