Rain Dog

Member
  • Content count

    298
  • Joined

  • Last visited

Community Reputation

136 Neutral

About Rain Dog

  • Rank
    Member
  1. +1 for bazaar. It works really well for me. As far as perforce goes, I cannot comprehend why anyone uses it. I use a version of it at work and as far as version control systems go, I think the only advantage it has is that it scales to TB sized repositories. The actual versioning system is very sub par compared to bzr/git/mercurial. And lets not forget the fact that it's also really really expensive.
  2. I was wondering if there is a way to read files greater than 4GB using std::ifstream? I already have a solution that works better than I could have imagined on files that are 1.8GB that uses buffering but when I needed to process a 6.8GB file, it didn't read a single byte. What I don't understand is that std::ios::pos_type is 24 bytes in size but std::streamsize is 4 bytes. Is there a way to get 8 bytes size? void stream_fill_string_n(std::ifstream *stream, std::string &output, unsigned int max_size) { std::ios::pos_type cur_read = stream->tellg(); stream->seekg(0, std::ios::end); std::ios::pos_type read_avail = stream->tellg() - cur_read; stream->seekg(cur_read); std::size_t fill_start = output.length() > 0 ? output.length() - 1 : 0; if(read_avail < static_cast<std::ios::pos_type>(max_size)) { max_size = read_avail; } output.resize(max_size + fill_start+1); stream->read(&output[fill_start], static_cast<std::streamsize>(max_size)); } note: i moved this from the beginners forum as they probably have nfc.
  3. Why is C++ ifstream so slow in VS.NET 2008

    void stream_fill_string(std::ifstream *stream, std::string &output) { std::ios::pos_type size = stream_size(stream); output.resize(size); stream->read(&output[0], size); } Will read a lot faster. Look here: http://groups.google.com/group/perfo/browse_thread/thread/1ecf38b7d7ea7d38
  4. C compatable structs

    I was wondering when you would bring back the struct that would be C/C++ compatable. I have been toying with scripting a currently not scripted part of my app but it currently relies heavily on being able to cast arbitrary memory segments into structures.
  5. good texts

    If I recall, agner fog is a researcher at Intel.
  6. asBEHAVE_CAST

    I've been meaning to comment on this: I prefer the cast<type>(value) cast syntax over the rest. Secondly, the const_cast, static_cast, etc are useful for several reasons: 1. They provide additional semantics for users and demonstrate that the user is explicitly aware of the type of cast and generally what they expect the cast to be valid for. 2. They are way easier to find: Try creating the reg exp that 100% finds C-style casts, then one that finds C++ casts and tell me what one you finish first =)
  7. Functional programming features

    I think this code: List l = { ... } Function callback = new Function(int arg1, int arg2) { return arg1 > arg2 } qsort(list, callback); Is awesome.
  8. AS IDE - Beta

    I agree. Some type of easier to use debugger might be highly useful, something that might say, return a char* of the current stack, ability to add, remove break points, set conditional breakpoints, etc, might be highly useful.
  9. Deyja preprocessor

    FYI: My usage of your preprocessor has also required me to account for an off by one line error, or perhaps it is the way angelscript reports lines also.
  10. static methods and object handles

    What you can do to make it easier to add references, etc, is 1: inherit from a "Referenced" base class or 2, create a macro: DECLARE_IS_REFERENCEABLE().
  11. Binding Operators is bad for your sanity.

    I had a problem trying to bind operator[] using templates. I had a function like this: in essence this: template<class IndexType, class ReturnType, class ObjectType> ReturnType Indexer(IndexType i, ObjectType o) { return o[i]; } But I could never get it to resolve the 'ReturnType' template. The compiler always balked about not being able to find the function. I was using asFUNCTIONPR macro btw. I will have to retry it with your binder now, Deyja. EDIT: It appears now that the error could have been in the use of asFUNCTIONPR, as Deyja appears to be using asFUNCTION and passing template parameters, while I was doing asFUNCTIONPR(MyFunc, (int, int, vector), int) or something similar.
  12. AS IDE

    in the more general sense, a wrapper is something that will provide an easier to use interface to a complex or poorly written or logically similar group of functions. For example, I might want to create a wrapper over winsock that easily allows me to send an http request. I want to be able to use it like this: WinsockWrapper.MyHttpRequestMaker("this is my http post message"); The function would group together code that creates the connection, socket, and finally sends the data
  13. Question is it Possible to get an object Pointer...

    Register a smartptr type class w/ AS, then register a std::vector binding for the smart pointer class, and a creational method that returns the smart pointers, and you will have code like this: ObjArray myObjs; myObjs.PushBack(CreateSmartObject("Square"); That is kind of crappy way, but you should be able to improve on it.
  14. Link Error

    You'll need AS built prior to compiling the tutorial. And alternatively, may need to direct your linker to the angelscript.lib file.
  15. extending engine with dlls

    I link my DLL's w/ the angelscript.h header file. I export a simple function "RegisterPlugin" that takes an asIScriptEngine* and then register the API like you would any other way. The DLL is only dependant upon the angelscript.h interface declarations and works out fairly well. The problems you have to watch for are mostly memory management related, and for example, require you to use the same comiler/settings in some cases like for std::string registration. If your dll function takes a std::string from AS, it had best be the same std::string that it knows about otherwise you will crash.