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: 1,914
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

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: 7,996
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.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   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: 1,914
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?
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: 7,996
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.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   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 07:08 AM.


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