|
Problem is how to get the most recent tag read. if i run a cvs command, it gives me lot of information regarding the tags. But i can't get the most recent tag. And again I have to read the output from the standard output, which is little bit complicated.
Any suggestions?
|
|
|
|
|
scamguru wrote: And again I have to read the output from the standard output...
Which looks like what?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
it is a list of tags. example below,
for example
CODE_1-2-0:1.0.0.1
CODE_1-1-4:1.0.0.1
CODE_1-1-3:1.0.0.1
CODE_1-1-2:1.0.0.1
CODE_1-1-1:1.0.0.1
CODE_1-1-0:1.0.0.1
this will be standard output. and i have to read 1-2-0. This is a command output of cvs log <filename>
|
|
|
|
|
So read each line, and if the first 10 characters are "CODE_1-2-0", you've got a match.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
How can do that ?
"The Awaited Saviour", Mohammed Baqir Al Sadr
modified on Thursday, November 20, 2008 5:09 AM
|
|
|
|
|
Do you have a variable? If you do then you have a reference to it.
void foo(int &bar)
{
bar += 3;
}
int main()
{
int bar = 3;
foo(bar);
int *ptr = &bar;
foo (*ptr);
return 0;
}
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote: Do you have a variable? If you do then you have a reference to it.
ROTFLMAO You left out, "is it plugged in?"
led mike
|
|
|
|
|
That is exactly the problem : I do'nt have a variable.
in my case, the function fo is a callback triggered by external code (that cannot be changed).
i have a local function F1 where i would like it to trigger that callback,same as the external code does. The aim is to enable two scenarios to be handled together. Problem is that even if that function F1 would not require to pass a certain parameter, and that neither the processing code in the callbackwould need to collect its content at that case, then the parameter is a reference to a class type which constructor is private (meaning I cannot simply instantiate a temporary var then pass it). Adds to that the fact that the external code can't be changed and it even does not expose a class factory for that type.
Are there any workaround though ?
Thank you.
|
|
|
|
|
Please post some code, the above scenario is soooooo funny!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
see last message M.Pallini. BTW, how are you ?
|
|
|
|
|
What's the last message?
BTW Voting 1 won't help you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
=the last reply in the whole set of recursive replies related to the forum thread.(the reply where I replied to myself).
I always vote either 1 or 2 or 5.
|
|
|
|
|
hINTModuleState wrote: the reply where I replied to myself
OK.
hINTModuleState wrote: I always vote either 1 or 2 or 5.
This is (of course) up to you. I was pointing out that our replies were indeed reasonable, since you possibly want to insist on bad design, and providing a cluttered scenario to justify your choice. You're basically saying (roughly):"Ok this is an ugly trick but I want it because my scenario is complex", that is bad design.
I hope toxcct is not looking at this thread, since I'm doing desing philosophical statements.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: since you possibly want to insist on bad design, and providing a cluttered scenario to justify your choice. You're basically saying (roughly):"Ok this is an ugly trick but I want it because my scenario is complex", that is bad design.
If it was not because of the "possibly" adverb, then I would have felt accused. I am a good guy standing on the hand of those who worries about good design ( for the least).
|
|
|
|
|
hINTModuleState wrote: If it was not because of the "possibly" adverb, then I would have felt accused.
Well, I give a chance even to the worst coder (I'm kidding).
hINTModuleState wrote: I am a good guy standing on the hand of those who worries about good design ( for the least).
You're a good guy who possibly needs a deeper knowledge about OOP .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Usually the purpose is not to fool the compiler...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Usually the purpose is not to fool the compiler...
Which was my point here: [.]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thank you, following the link I got the today's CP memorable quote[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Thank you, following the link I got the today's CP memorable quote
Glad to be of service.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Usually functions are declared that way to be certain that an existing object is provided, because otherwise it would not serve any point of calling the function. Compare with the copy constructor.
If you feel you should call that function without a valid object to pass as reference, you have either misunderstood what the function does or the one who declared it didn't understand the concept of references.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Please see my above reply so you understand the scenario I am with.
Thank you.
|
|
|
|
|
Well, when I saw PJ's reply I became unsure whether you actually have a variable but wasn't familiar with the concept of references, or you don't have an object at all.
The small novel in your reply to PJ is hard to understand. It would be easier to understand it if you showed the declarations of the functions.
However, my first reply still stands: either you're using the API the wrong way, or the API is poorly designed. It doesn't matter how obscure the description is of how you are going about it.
Are you sure the class with the private constructor is not implemented as a singleton? When I implement singletons I usually protect the constructors and have a static declared member function such as GetInstance() that would create the object if it hasn't been created earlier, but hand out a pointer to it if the object already exists.
If this is the case you could get hold of the one and only object there is to pass and as I understand your description that would solve your problem.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
i tried to make it more clear in the last message, ie the unclear novel I recited.
there were neither a getinstance internal methode neither a createinstance inside a helper class factory.
Thank you anyway.(note the solution i was given : it fools the compiler and it was just what i wanted).
|
|
|
|
|
hINTModuleState wrote: note the solution i was given : it fools the compiler and it was just what i wanted
Mmmm, I saw the "solution" and I thought "this is exactly why it's been said about C++ that it's harder to shoot yourself in the foot than in C, but when you do it blows your whole leg off".
At the best, the API is poorly designed and this will actually work, which means that the programmer that designed the API didn't really know how to use references and their purpose.
At the worst, it seems to work, but it will crash later after you've distributed the application under obscure circumstances. Then you'll have an angry customer, or several, that requires an immediate fix and you have no idea of how to solve it.
Either way you will end up with a solution that you cannot really rely on and it will be "proven by use".
Best of luck!
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
the things you are saying are not to be questioned. They are full of logic.
Actually the API is well designed. It uses all sorts of OO things and others,etc well in place : const, reference types,public, protected..
As I tried to explain in the bottom replay (the one I replied to myself) the case I am with and the context where I am trying to shout myself in the foot is just a case where I want to ensure a part of code to be well designed, compact and easy to improve. The leg wo'nt be blown off hopefully.
|
|
|
|