Click here to Skip to main content
15,889,462 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Calculute average value of large array Pin
Stefan_Lang11-Aug-14 23:07
Stefan_Lang11-Aug-14 23:07 
QuestionApparently different behaviour assigning C string to std::string, for Relese/Debug Pin
piul8-Aug-14 4:36
piul8-Aug-14 4:36 
AnswerRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
jeron18-Aug-14 5:00
jeron18-Aug-14 5:00 
GeneralRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
piul10-Aug-14 21:39
piul10-Aug-14 21:39 
AnswerRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
Richard MacCutchan8-Aug-14 5:57
mveRichard MacCutchan8-Aug-14 5:57 
AnswerRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
«_Superman_»8-Aug-14 18:58
professional«_Superman_»8-Aug-14 18:58 
GeneralRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
piul10-Aug-14 21:42
piul10-Aug-14 21:42 
QuestionHow to design (and do I want) an API? Pin
piul6-Aug-14 2:31
piul6-Aug-14 2:31 
Hi,
I'm working on a small libarary that will parse and modify a certain type of configuration file. As suggested by wise people (I think) I'd like to hide away the implementation and offer the user a set of functions to use the library.
I have questions mainly philosophical or concerning style. I'll put here my idea and it'd be very nice to get your opinions on it.
C++
#ifndef CONFIGFILEAPI_H_INCLUDED
#define CONFIGFILEAPI_H_INCLUDED

#include <string>
#include <vector>

namespace cfgFileLib
{
//open and parse a file
// Returns:
//  empty string "" if succesful
//  error description if not
std::string openConfigFile (const std::string & fileName);

//check if a symbol is defined
bool isDefined (const std::string & symbol);

//how many values are assigned this symbol
int howMany (const std::string & symbol);

//get first (or only) value assigned to the given symbol
bool getBool (const std::string & symbol);
int getInt (const std::string & symbol);
double getDouble (const std::string & symbol);
std::string getString (const std::string & symbol);

//get all the values assgined to the given symbol
std::vector <bool> getAllBool (const std::string & symbol);
std::vector <int> getAllInt (const std::string & symbol);
std::vector <double> getAllDouble (const std::string & symbol);
std::vector <std::string> getAllString (const std::string & symbol);
}
#endif


- Does this design make sense in general?
- Do I put it all whithin a namespace?

modified 6-Aug-14 8:51am.

AnswerRe: How to design (and do I want) an API? Pin
Espen Harlinn6-Aug-14 2:55
professionalEspen Harlinn6-Aug-14 2:55 
GeneralRe: How to design (and do I want) an API? Pin
piul6-Aug-14 2:59
piul6-Aug-14 2:59 
GeneralRe: How to design (and do I want) an API? Pin
Espen Harlinn6-Aug-14 3:09
professionalEspen Harlinn6-Aug-14 3:09 
AnswerRe: How to design (and do I want) an API? Pin
Cristian Amarie14-Aug-14 22:16
Cristian Amarie14-Aug-14 22:16 
QuestionConvert console to windows gui application Pin
Member 109951396-Aug-14 0:12
Member 109951396-Aug-14 0:12 
AnswerRe: Convert console to windows gui application Pin
Richard MacCutchan6-Aug-14 1:06
mveRichard MacCutchan6-Aug-14 1:06 
AnswerRe: Convert console to windows gui application Pin
Joe Woodbury6-Aug-14 15:38
professionalJoe Woodbury6-Aug-14 15:38 
AnswerRe: Convert console to windows gui application Pin
Cristian Amarie17-Aug-14 19:33
Cristian Amarie17-Aug-14 19:33 
Questionwhat is zed doing here? Pin
Alex Sturza5-Aug-14 8:29
Alex Sturza5-Aug-14 8:29 
AnswerRe: what is zed doing here? Pin
CPallini5-Aug-14 10:02
mveCPallini5-Aug-14 10:02 
GeneralRe: what is zed doing here? Pin
Alex Sturza5-Aug-14 10:46
Alex Sturza5-Aug-14 10:46 
GeneralRe: what is zed doing here? Pin
CPallini5-Aug-14 20:48
mveCPallini5-Aug-14 20:48 
AnswerRe: what is zed doing here? Pin
jeron15-Aug-14 11:17
jeron15-Aug-14 11:17 
GeneralRe: what is zed doing here? Pin
Alex Sturza5-Aug-14 11:28
Alex Sturza5-Aug-14 11:28 
GeneralRe: what is zed doing here? Pin
jeron15-Aug-14 11:41
jeron15-Aug-14 11:41 
GeneralRe: what is zed doing here? Pin
Alex Sturza5-Aug-14 11:46
Alex Sturza5-Aug-14 11:46 
AnswerRe: what is zed doing here? Pin
Pete O'Hanlon5-Aug-14 12:27
mvePete O'Hanlon5-Aug-14 12:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.