COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 09-20-2019, 11:47 AM   #1
WyattRice
Human being with feelings
 
WyattRice's Avatar
 
Join Date: Sep 2009
Location: Virginia
Posts: 2,067
Default WDL_FastString Newbie Question

Hi all.
I was wondering if WDL_FastString could be used to format some cmdline arguments for a third party cmdline app?

I'm currently using std::string for example.
Code:
	DWORD dwRetVal = 0;
	CHAR lpTempPathBuffer[MAX_PATH] = { NULL };
	dwRetVal = GetTempPath(MAX_PATH,          // length of the buffer
		lpTempPathBuffer);

Code:
string cmdline = (string)+("tools/ddpinfo.exe") + " " + "--version" + " " + "-v 3" + " " + (string)+"\"" + dir_sel + "\""  + " " + "-w" + " " + (string)+"\"" + lpTempPathBuffer  + "Image.wav";
The output of the cmdline is:
Code:
tools/ddpinfo.exe --version -v 3 "C:\Users\Wyatt\Desktop\DDP project folder" -w "C:\Users\Wyatt\AppData\Local\Temp\Image.wav
Thanks in advance.
Wyatt
__________________
DDP To Cue Writer. | DDP Marker Editor.

Last edited by WyattRice; 09-20-2019 at 11:53 AM.
WyattRice is offline   Reply With Quote
Old 09-20-2019, 12:55 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by WyattRice View Post
Hi all.
The output of the cmdline is:
Code:
tools/ddpinfo.exe --version -v 3 "C:\Users\Wyatt\Desktop\DDP project folder" -w "C:\Users\Wyatt\AppData\Local\Temp\Image.wav
Your current code is missing the finishing ", so if it's not working, maybe it's because of that.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 09-20-2019, 01:50 PM   #3
WyattRice
Human being with feelings
 
WyattRice's Avatar
 
Join Date: Sep 2009
Location: Virginia
Posts: 2,067
Default

Hi Xen.
Thanks for the reply.

Yeah, when I copied and pasted, I left out the last "

It currently is working ok, I was just wondering if I could replace the std:string with WDLFastString to format the cmd aurguments?

This is working
Code:
string cmdline
Would it be possible to work with WDL_FastString cmdline instead?
__________________
DDP To Cue Writer. | DDP Marker Editor.
WyattRice is offline   Reply With Quote
Old 09-20-2019, 03:08 PM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by WyattRice View Post
Would it be possible to work with WDL_FastString cmdline instead?
Probably, but I don't imagine there's any huge difference. In any case, when working with strings in C++, stick to a single implementation. If WDL_String or or WDL_FastString work OK for your purposes, don't mix in std::strings etc...It's often difficult to tell what the string implementations are actually doing and you might end up making unnecessary memory copies and so on. When you need to interface with plain C code, the C++ strings usually have some way to get a const char* or char* out of the string object.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.